protected function Workflow::rebuildRoles in Workflow 7.2
2 calls to Workflow::rebuildRoles()
- Workflow::preRebuild in includes/Entity/Workflow.php
- Rebuild things that get saved with this entity.
- Workflow::rebuildInternals in includes/Entity/Workflow.php
- Rebuild internals that get saved separately.
File
- includes/Entity/Workflow.php, line 701
- Contains workflow\includes\Entity\Workflow.
Contains workflow\includes\Entity\WorkflowController.
Class
- Workflow
Code
protected function rebuildRoles(array $roles) {
$new_roles = array();
$role_map = workflow_get_roles(NULL, FALSE);
foreach ($roles as $key => $rid) {
if ($rid == WORKFLOW_ROLE_AUTHOR_RID) {
$new_roles[$rid] = $rid;
}
else {
if ($role = user_role_load_by_name($role_map[$rid])) {
$new_roles[$role->rid] = (int) $role->rid;
}
}
}
return $new_roles;
}