You are here

social_comment_upload.install in Open Social 8.8

Installation file for Social Comment Upload.

File

modules/social_features/social_comment_upload/social_comment_upload.install
View source
<?php

/**
 * @file
 * Installation file for Social Comment Upload.
 */

/**
 * Install the module.
 */
function social_comment_upload_install() {

  // Sitemanagers should be able to change the settings.
  user_role_grant_permissions('sitemanager', [
    'administer social_comment_upload settings',
  ]);
}

/**
 * Set default values for social comment upload access.
 */
function social_comment_upload_update_8001() {

  // This update we introduce some settings for which we set the default values
  // and permissions.
  // By default attachment uploading is allowed.
  \Drupal::configFactory()
    ->getEditable('social_comment_upload.settings')
    ->set('allow_upload_comments', TRUE)
    ->save();

  // SM should be able to change the permissions.
  user_role_grant_permissions('sitemanager', [
    'administer social_comment_upload settings',
  ]);
}

Functions

Namesort descending Description
social_comment_upload_install Install the module.
social_comment_upload_update_8001 Set default values for social comment upload access.