function flag_entity::get_permissions in Flag 7.3
Provides permissions for this flag.
Return value
An array of permissions for hook_permission().
Overrides flag_flag::get_permissions
File
- includes/
flag/ flag_entity.inc, line 143 - Contains the flag_entity class.
Class
- flag_entity
- Base entity flag handler.
Code
function get_permissions() {
// For entity flags, use the human label of the entity.
$entity_info = entity_get_info($this->entity_type);
$entity_label = $entity_info['label'];
return array(
"flag {$this->name}" => array(
'title' => t('Flag %entity entities as %flag_title', array(
'%flag_title' => $this->title,
'%entity' => $entity_label,
)),
),
"unflag {$this->name}" => array(
'title' => t('Unflag %entity entities as %flag_title', array(
'%flag_title' => $this->title,
'%entity' => $entity_label,
)),
),
);
}