Roles and Permissions
Permissions
Records Access
Expanding access
Roles
add_filter( 'dt_set_roles_and_permissions', [ $this, 'dt_set_roles_and_permissions' ], 10, 1 );
public function dt_set_roles_and_permissions( $expected_roles ){
$expected_roles['dispatcher'] = [
"label" => __( "Dispatcher", "disciple_tools" ), // the displayed name of the role
"descriptions" => "Monitor new D.T contacts and assign the to waiting Multipliers", //description shown to help the admin choose what role to assign a user.
"permissions" => [
'dt_all_access_contacts' => true, //gives permission to all contacts with the 'access' type.
'view_project_metrics' => true, //view all poject chart is the metrics tab
'list_users' => true, //list users in the wp-admin
'dt_list_users' => true, //list user in the theme (needed for assigning to multipliers)
]
];
return $expected_roles;
}Linking capabilities to permissions
In listing records
In viewing records
In updating records
In deleting records
Last updated