mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Implement hook_farm_manager_perms().
This commit is contained in:
parent
a0f623741b
commit
a4e0722efe
1 changed files with 26 additions and 0 deletions
|
@ -18,6 +18,32 @@ function farm_log_permission() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_farm_manager_perms().
|
||||
*/
|
||||
function farm_log_farm_manager_perms() {
|
||||
|
||||
// Grant manager permissions to default log types and taxonomies.
|
||||
$types = array(
|
||||
'log' => array(
|
||||
'farm_activity',
|
||||
'farm_movement',
|
||||
'farm_observation',
|
||||
),
|
||||
'taxonomy' => array(
|
||||
'farm_observation_types',
|
||||
'farm_priority',
|
||||
'farm_quantity_units',
|
||||
),
|
||||
);
|
||||
$perms = farm_manager_entity_perms($types);
|
||||
|
||||
// Add 'view farm logs' permission.
|
||||
$perms[] = 'view farm logs';
|
||||
|
||||
return $perms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_farm_admin_actions().
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue