You are here

function file_entity_update_7104 in File Entity (fieldable files) 7

Same name and namespace in other branches
  1. 7.3 file_entity.install \file_entity_update_7104()
  2. 7.2 file_entity.install \file_entity_update_7104()

Assign view file permission when updating without the Media module.

File

./file_entity.install, line 237
Install, update and uninstall functions for the file_entity module.

Code

function file_entity_update_7104() {
  if (!module_exists('media')) {
    $roles = user_roles(FALSE, 'view file');
    if (empty($roles)) {

      // Set permissions.
      $roles = user_roles();
      foreach ($roles as $rid => $role) {
        user_role_grant_permissions($rid, array(
          'view file',
        ));
      }
    }
  }
}