Full ELMS Learning Network documentation
function file_entity_list_permissions
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 file_entity.module | file_entity_list_permissions($type) |
cle7 file_entity.module | file_entity_list_permissions($type) |
elmsmedia7 file_entity.module | file_entity_list_permissions($type) |
icor7 file_entity.module | file_entity_list_permissions($type) |
meedjum_blog7 file_entity.module | file_entity_list_permissions($type) |
mooc7 file_entity.module | file_entity_list_permissions($type) |
Helper function to generate standard file permission list for a given type.
Parameters
$type: The machine-readable name of the file type.
Return value
array An array of permission names and descriptions.
Related topics
2 calls to file_entity_list_permissions()
- file_entity_permission in sites/
all/ modules/ ulmus/ file_entity/ file_entity.module - Implement hook_permission().
- media_update_7200 in sites/
all/ modules/ ulmus/ media/ media.install - Replace 'view media' perm from all users having the role with 'view file'.
1 string reference to 'file_entity_list_permissions'
- media_update_7200 in sites/
all/ modules/ ulmus/ media/ media.install - Replace 'view media' perm from all users having the role with 'view file'.
File
- sites/
all/ modules/ ulmus/ file_entity/ file_entity.module, line 1952 - Extends Drupal file entities to be fieldable and viewable.
Code
function file_entity_list_permissions($type) {
$info = file_type_load($type);
// Build standard list of file permissions for this type.
$permissions = array(
"edit own $type files" => array(
'title' => t('%type_name: Edit own files', array('%type_name' => $info->label)),
),
"edit any $type files" => array(
'title' => t('%type_name: Edit any files', array('%type_name' => $info->label)),
),
"delete own $type files" => array(
'title' => t('%type_name: Delete own files', array('%type_name' => $info->label)),
),
"delete any $type files" => array(
'title' => t('%type_name: Delete any files', array('%type_name' => $info->label)),
),
"download own $type files" => array(
'title' => t('%type_name: Download own files', array('%type_name' => $info->label)),
),
"download any $type files" => array(
'title' => t('%type_name: Download any files', array('%type_name' => $info->label)),
),
);
return $permissions;
}