コード例 #1
0
 public function actionEditRights($id)
 {
     $group = Group::getById(intval($id));
     $title = Zurmo::t('ZurmoModule', 'Rights');
     $breadCrumbLinks = array(strval($group) => array('group/' . static::resolveBreadCrumbActionByGroup($group), 'id' => $id), $title);
     $rightsData = RightsUtil::getAllModuleRightsDataByPermitable($group);
     $rightsForm = RightsFormUtil::makeFormFromRightsData($rightsData);
     $postVariableName = get_class($rightsForm);
     if (isset($_POST[$postVariableName])) {
         $castedPostData = RightsFormUtil::typeCastPostData($_POST[$postVariableName]);
         if (RightsFormUtil::setRightsFromCastedPost($castedPostData, $group)) {
             $this->clearCaches();
             $group->forget();
             $group = Group::getById(intval($id));
             Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Rights Saved Successfully.'));
             $action = $this->resolveActionToGoToAfterSave($group);
             $this->redirect(array($this->getId() . '/' . $action, 'id' => $group->id));
             Yii::app()->end(0, false);
         }
     }
     $metadata = RightsEditViewUtil::resolveMetadataFromData($rightsForm->data, RightsEditAndDetailsView::getMetadata());
     $titleBarAndEditView = new GroupActionBarAndSecurityEditView($this->getId(), $this->getModule()->getId(), $rightsForm, $group, $this->getModule()->getPluralCamelCasedName(), $metadata, 'RightsEditAndDetailsView', 'GroupRightsEditMenu');
     $view = new GroupsPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $titleBarAndEditView, $breadCrumbLinks, 'GroupBreadCrumbView'));
     echo $view->render();
 }
コード例 #2
0
 /**
  * @depends testRightsFormUtil
  */
 public function testRightsFormUtilSetRightsFromPost()
 {
     $group = Group::getByName('viewGroup');
     $data = RightsUtil::getAllModuleRightsDataByPermitable($group);
     $form = RightsFormUtil::makeFormFromRightsData($data);
     $compareData = array('AccountsModule' => array('RIGHT_CREATE_ACCOUNTS' => array('displayName' => AccountsModule::RIGHT_CREATE_ACCOUNTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_ACCOUNTS' => array('displayName' => AccountsModule::RIGHT_DELETE_ACCOUNTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_ACCOUNTS' => array('displayName' => AccountsModule::RIGHT_ACCESS_ACCOUNTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'CampaignsModule' => array('RIGHT_CREATE_CAMPAIGNS' => array('displayName' => CampaignsModule::RIGHT_CREATE_CAMPAIGNS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CAMPAIGNS' => array('displayName' => CampaignsModule::RIGHT_DELETE_CAMPAIGNS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CAMPAIGNS' => array('displayName' => CampaignsModule::RIGHT_ACCESS_CAMPAIGNS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ContactsModule' => array('RIGHT_CREATE_CONTACTS' => array('displayName' => ContactsModule::RIGHT_CREATE_CONTACTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CONTACTS' => array('displayName' => ContactsModule::RIGHT_DELETE_CONTACTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONTACTS' => array('displayName' => ContactsModule::RIGHT_ACCESS_CONTACTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ContactWebFormsModule' => array('RIGHT_CREATE_CONTACT_WEB_FORMS' => array('displayName' => ContactWebFormsModule::RIGHT_CREATE_CONTACT_WEB_FORMS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CONTACT_WEB_FORMS' => array('displayName' => ContactWebFormsModule::RIGHT_DELETE_CONTACT_WEB_FORMS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONTACT_WEB_FORMS' => array('displayName' => ContactWebFormsModule::RIGHT_ACCESS_CONTACT_WEB_FORMS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ConversationsModule' => array('RIGHT_CREATE_CONVERSATIONS' => array('displayName' => ConversationsModule::RIGHT_CREATE_CONVERSATIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CONVERSATIONS' => array('displayName' => ConversationsModule::RIGHT_DELETE_CONVERSATIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONVERSATIONS' => array('displayName' => ConversationsModule::RIGHT_ACCESS_CONVERSATIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'DesignerModule' => array('RIGHT_ACCESS_DESIGNER' => array('displayName' => DesignerModule::RIGHT_ACCESS_DESIGNER, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'EmailMessagesModule' => array('RIGHT_CREATE_EMAIL_MESSAGES' => array('displayName' => EmailMessagesModule::RIGHT_CREATE_EMAIL_MESSAGES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_EMAIL_MESSAGES' => array('displayName' => EmailMessagesModule::RIGHT_DELETE_EMAIL_MESSAGES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_EMAIL_MESSAGES' => array('displayName' => EmailMessagesModule::RIGHT_ACCESS_EMAIL_MESSAGES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONFIGURATION' => array('displayName' => EmailMessagesModule::RIGHT_ACCESS_CONFIGURATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ExportModule' => array('RIGHT_ACCESS_EXPORT' => array('displayName' => ExportModule::RIGHT_ACCESS_EXPORT, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'HomeModule' => array('RIGHT_CREATE_DASHBOARDS' => array('displayName' => HomeModule::RIGHT_CREATE_DASHBOARDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_DASHBOARDS' => array('displayName' => HomeModule::RIGHT_DELETE_DASHBOARDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_DASHBOARDS' => array('displayName' => HomeModule::RIGHT_ACCESS_DASHBOARDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'JobsManagerModule' => array('RIGHT_ACCESS_JOBSMANAGER' => array('displayName' => JobsManagerModule::RIGHT_ACCESS_JOBSMANAGER, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'LeadsModule' => array('RIGHT_CREATE_LEADS' => array('displayName' => LeadsModule::RIGHT_CREATE_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_LEADS' => array('displayName' => LeadsModule::RIGHT_DELETE_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_LEADS' => array('displayName' => LeadsModule::RIGHT_ACCESS_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_CONVERT_LEADS' => array('displayName' => LeadsModule::RIGHT_CONVERT_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MapsModule' => array('RIGHT_ACCESS_MAPS_ADMINISTRATION' => array('displayName' => MapsModule::RIGHT_ACCESS_MAPS_ADMINISTRATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'NotesModule' => array('RIGHT_CREATE_NOTES' => array('displayName' => NotesModule::RIGHT_CREATE_NOTES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_NOTES' => array('displayName' => NotesModule::RIGHT_DELETE_NOTES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_NOTES' => array('displayName' => NotesModule::RIGHT_ACCESS_NOTES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'OpportunitiesModule' => array('RIGHT_CREATE_OPPORTUNITIES' => array('displayName' => OpportunitiesModule::RIGHT_CREATE_OPPORTUNITIES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_OPPORTUNITIES' => array('displayName' => OpportunitiesModule::RIGHT_DELETE_OPPORTUNITIES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_OPPORTUNITIES' => array('displayName' => OpportunitiesModule::RIGHT_ACCESS_OPPORTUNITIES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'GroupsModule' => array('RIGHT_CREATE_GROUPS' => array('displayName' => GroupsModule::RIGHT_CREATE_GROUPS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_GROUPS' => array('displayName' => GroupsModule::RIGHT_DELETE_GROUPS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_GROUPS' => array('displayName' => GroupsModule::RIGHT_ACCESS_GROUPS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ImportModule' => array('RIGHT_ACCESS_IMPORT' => array('displayName' => ImportModule::RIGHT_ACCESS_IMPORT, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MeetingsModule' => array('RIGHT_CREATE_MEETINGS' => array('displayName' => MeetingsModule::RIGHT_CREATE_MEETINGS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_MEETINGS' => array('displayName' => MeetingsModule::RIGHT_DELETE_MEETINGS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_MEETINGS' => array('displayName' => MeetingsModule::RIGHT_ACCESS_MEETINGS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'RolesModule' => array('RIGHT_CREATE_ROLES' => array('displayName' => RolesModule::RIGHT_CREATE_ROLES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_ROLES' => array('displayName' => RolesModule::RIGHT_DELETE_ROLES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_ROLES' => array('displayName' => RolesModule::RIGHT_ACCESS_ROLES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'TasksModule' => array('RIGHT_CREATE_TASKS' => array('displayName' => TasksModule::RIGHT_CREATE_TASKS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_TASKS' => array('displayName' => TasksModule::RIGHT_DELETE_TASKS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_TASKS' => array('displayName' => TasksModule::RIGHT_ACCESS_TASKS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ZurmoModule' => array('RIGHT_ACCESS_ADMINISTRATION' => array('displayName' => ZurmoModule::RIGHT_ACCESS_ADMINISTRATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_BULK_DELETE' => array('displayName' => ZurmoModule::RIGHT_BULK_DELETE, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_BULK_WRITE' => array('displayName' => ZurmoModule::RIGHT_BULK_WRITE, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_GLOBAL_CONFIGURATION' => array('displayName' => ZurmoModule::RIGHT_ACCESS_GLOBAL_CONFIGURATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CURRENCY_CONFIGURATION' => array('displayName' => ZurmoModule::RIGHT_ACCESS_CURRENCY_CONFIGURATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'UsersModule' => array('RIGHT_CHANGE_USER_PASSWORDS' => array('displayName' => UsersModule::RIGHT_CHANGE_USER_PASSWORDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_WEB' => array('displayName' => 'Sign in Via Web', 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_MOBILE' => array('displayName' => 'Sign in Via Mobile', 'explicit' => Right::ALLOW, 'inherited' => null, 'effective' => Right::ALLOW), 'RIGHT_LOGIN_VIA_WEB_API' => array('displayName' => 'Sign in Via Web API', 'explicit' => null, 'inherited' => Right::ALLOW, 'effective' => Right::ALLOW), 'RIGHT_CREATE_USERS' => array('displayName' => UsersModule::RIGHT_CREATE_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_USERS' => array('displayName' => UsersModule::RIGHT_ACCESS_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MissionsModule' => array('RIGHT_CREATE_MISSIONS' => array('displayName' => MissionsModule::RIGHT_CREATE_MISSIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_MISSIONS' => array('displayName' => MissionsModule::RIGHT_DELETE_MISSIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_MISSIONS' => array('displayName' => MissionsModule::RIGHT_ACCESS_MISSIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ReportsModule' => array('RIGHT_CREATE_REPORTS' => array('displayName' => ReportsModule::RIGHT_CREATE_REPORTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_REPORTS' => array('displayName' => ReportsModule::RIGHT_DELETE_REPORTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_REPORTS' => array('displayName' => ReportsModule::RIGHT_ACCESS_REPORTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'WorkflowsModule' => array('RIGHT_CREATE_WORKFLOWS' => array('displayName' => WorkflowsModule::RIGHT_CREATE_WORKFLOWS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_WORKFLOWS' => array('displayName' => WorkflowsModule::RIGHT_DELETE_WORKFLOWS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_WORKFLOWS' => array('displayName' => WorkflowsModule::RIGHT_ACCESS_WORKFLOWS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'SocialItemsModule' => array('RIGHT_ACCESS_SOCIAL_ITEMS' => array('displayName' => 'Access Social Items', 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MarketingModule' => array('RIGHT_ACCESS_MARKETING' => array('displayName' => MarketingModule::RIGHT_ACCESS_MARKETING, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'EmailTemplatesModule' => array('RIGHT_CREATE_EMAIL_TEMPLATES' => array('displayName' => EmailTemplatesModule::RIGHT_CREATE_EMAIL_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_EMAIL_TEMPLATES' => array('displayName' => EmailTemplatesModule::RIGHT_DELETE_EMAIL_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_EMAIL_TEMPLATES' => array('displayName' => EmailTemplatesModule::RIGHT_ACCESS_EMAIL_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MarketingListsModule' => array('RIGHT_CREATE_MARKETING_LISTS' => array('displayName' => MarketingListsModule::RIGHT_CREATE_MARKETING_LISTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_MARKETING_LISTS' => array('displayName' => MarketingListsModule::RIGHT_DELETE_MARKETING_LISTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_MARKETING_LISTS' => array('displayName' => MarketingListsModule::RIGHT_ACCESS_MARKETING_LISTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ProductTemplatesModule' => array('RIGHT_CREATE_PRODUCT_TEMPLATES' => array('displayName' => ProductTemplatesModule::RIGHT_CREATE_PRODUCT_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_PRODUCT_TEMPLATES' => array('displayName' => ProductTemplatesModule::RIGHT_DELETE_PRODUCT_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_PRODUCT_TEMPLATES' => array('displayName' => ProductTemplatesModule::RIGHT_ACCESS_PRODUCT_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ProductsModule' => array('RIGHT_CREATE_PRODUCTS' => array('displayName' => ProductsModule::RIGHT_CREATE_PRODUCTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_PRODUCTS' => array('displayName' => ProductsModule::RIGHT_DELETE_PRODUCTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_PRODUCTS' => array('displayName' => ProductsModule::RIGHT_ACCESS_PRODUCTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)));
     $this->assertEquals($compareData, $form->data);
     $fakePost = array('UsersModule__RIGHT_LOGIN_VIA_WEB_API' => strval(Right::ALLOW), 'UsersModule__RIGHT_LOGIN_VIA_MOBILE' => '', 'UsersModule__RIGHT_LOGIN_VIA_WEB' => strval(Right::DENY));
     $fakePost = RightsFormUtil::typeCastPostData($fakePost);
     $saved = RightsFormUtil::setRightsFromCastedPost($fakePost, $group);
     $this->assertTrue($saved);
     $group->forget();
     $group = Group::getByName('viewGroup');
     $compareData = array('AccountsModule' => array('RIGHT_CREATE_ACCOUNTS' => array('displayName' => AccountsModule::RIGHT_CREATE_ACCOUNTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_ACCOUNTS' => array('displayName' => AccountsModule::RIGHT_DELETE_ACCOUNTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_ACCOUNTS' => array('displayName' => AccountsModule::RIGHT_ACCESS_ACCOUNTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'CampaignsModule' => array('RIGHT_CREATE_CAMPAIGNS' => array('displayName' => CampaignsModule::RIGHT_CREATE_CAMPAIGNS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CAMPAIGNS' => array('displayName' => CampaignsModule::RIGHT_DELETE_CAMPAIGNS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CAMPAIGNS' => array('displayName' => CampaignsModule::RIGHT_ACCESS_CAMPAIGNS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ContactsModule' => array('RIGHT_CREATE_CONTACTS' => array('displayName' => ContactsModule::RIGHT_CREATE_CONTACTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CONTACTS' => array('displayName' => ContactsModule::RIGHT_DELETE_CONTACTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONTACTS' => array('displayName' => ContactsModule::RIGHT_ACCESS_CONTACTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ContactWebFormsModule' => array('RIGHT_CREATE_CONTACT_WEB_FORMS' => array('displayName' => ContactWebFormsModule::RIGHT_CREATE_CONTACT_WEB_FORMS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CONTACT_WEB_FORMS' => array('displayName' => ContactWebFormsModule::RIGHT_DELETE_CONTACT_WEB_FORMS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONTACT_WEB_FORMS' => array('displayName' => ContactWebFormsModule::RIGHT_ACCESS_CONTACT_WEB_FORMS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ConversationsModule' => array('RIGHT_CREATE_CONVERSATIONS' => array('displayName' => ConversationsModule::RIGHT_CREATE_CONVERSATIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_CONVERSATIONS' => array('displayName' => ConversationsModule::RIGHT_DELETE_CONVERSATIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONVERSATIONS' => array('displayName' => ConversationsModule::RIGHT_ACCESS_CONVERSATIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'DesignerModule' => array('RIGHT_ACCESS_DESIGNER' => array('displayName' => DesignerModule::RIGHT_ACCESS_DESIGNER, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'EmailMessagesModule' => array('RIGHT_CREATE_EMAIL_MESSAGES' => array('displayName' => EmailMessagesModule::RIGHT_CREATE_EMAIL_MESSAGES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_EMAIL_MESSAGES' => array('displayName' => EmailMessagesModule::RIGHT_DELETE_EMAIL_MESSAGES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_EMAIL_MESSAGES' => array('displayName' => EmailMessagesModule::RIGHT_ACCESS_EMAIL_MESSAGES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CONFIGURATION' => array('displayName' => EmailMessagesModule::RIGHT_ACCESS_CONFIGURATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ExportModule' => array('RIGHT_ACCESS_EXPORT' => array('displayName' => ExportModule::RIGHT_ACCESS_EXPORT, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'HomeModule' => array('RIGHT_CREATE_DASHBOARDS' => array('displayName' => HomeModule::RIGHT_CREATE_DASHBOARDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_DASHBOARDS' => array('displayName' => HomeModule::RIGHT_DELETE_DASHBOARDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_DASHBOARDS' => array('displayName' => HomeModule::RIGHT_ACCESS_DASHBOARDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'JobsManagerModule' => array('RIGHT_ACCESS_JOBSMANAGER' => array('displayName' => JobsManagerModule::RIGHT_ACCESS_JOBSMANAGER, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'LeadsModule' => array('RIGHT_CREATE_LEADS' => array('displayName' => LeadsModule::RIGHT_CREATE_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_LEADS' => array('displayName' => LeadsModule::RIGHT_DELETE_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_LEADS' => array('displayName' => LeadsModule::RIGHT_ACCESS_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_CONVERT_LEADS' => array('displayName' => LeadsModule::RIGHT_CONVERT_LEADS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MapsModule' => array('RIGHT_ACCESS_MAPS_ADMINISTRATION' => array('displayName' => MapsModule::RIGHT_ACCESS_MAPS_ADMINISTRATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'NotesModule' => array('RIGHT_CREATE_NOTES' => array('displayName' => NotesModule::RIGHT_CREATE_NOTES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_NOTES' => array('displayName' => NotesModule::RIGHT_DELETE_NOTES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_NOTES' => array('displayName' => NotesModule::RIGHT_ACCESS_NOTES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'OpportunitiesModule' => array('RIGHT_CREATE_OPPORTUNITIES' => array('displayName' => OpportunitiesModule::RIGHT_CREATE_OPPORTUNITIES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_OPPORTUNITIES' => array('displayName' => OpportunitiesModule::RIGHT_DELETE_OPPORTUNITIES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_OPPORTUNITIES' => array('displayName' => OpportunitiesModule::RIGHT_ACCESS_OPPORTUNITIES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'GroupsModule' => array('RIGHT_CREATE_GROUPS' => array('displayName' => GroupsModule::RIGHT_CREATE_GROUPS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_GROUPS' => array('displayName' => GroupsModule::RIGHT_DELETE_GROUPS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_GROUPS' => array('displayName' => GroupsModule::RIGHT_ACCESS_GROUPS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ImportModule' => array('RIGHT_ACCESS_IMPORT' => array('displayName' => ImportModule::RIGHT_ACCESS_IMPORT, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MeetingsModule' => array('RIGHT_CREATE_MEETINGS' => array('displayName' => MeetingsModule::RIGHT_CREATE_MEETINGS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_MEETINGS' => array('displayName' => MeetingsModule::RIGHT_DELETE_MEETINGS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_MEETINGS' => array('displayName' => MeetingsModule::RIGHT_ACCESS_MEETINGS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'RolesModule' => array('RIGHT_CREATE_ROLES' => array('displayName' => RolesModule::RIGHT_CREATE_ROLES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_ROLES' => array('displayName' => RolesModule::RIGHT_DELETE_ROLES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_ROLES' => array('displayName' => RolesModule::RIGHT_ACCESS_ROLES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'TasksModule' => array('RIGHT_CREATE_TASKS' => array('displayName' => TasksModule::RIGHT_CREATE_TASKS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_TASKS' => array('displayName' => TasksModule::RIGHT_DELETE_TASKS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_TASKS' => array('displayName' => TasksModule::RIGHT_ACCESS_TASKS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ZurmoModule' => array('RIGHT_ACCESS_ADMINISTRATION' => array('displayName' => ZurmoModule::RIGHT_ACCESS_ADMINISTRATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_BULK_DELETE' => array('displayName' => ZurmoModule::RIGHT_BULK_DELETE, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_BULK_WRITE' => array('displayName' => ZurmoModule::RIGHT_BULK_WRITE, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_GLOBAL_CONFIGURATION' => array('displayName' => ZurmoModule::RIGHT_ACCESS_GLOBAL_CONFIGURATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_CURRENCY_CONFIGURATION' => array('displayName' => ZurmoModule::RIGHT_ACCESS_CURRENCY_CONFIGURATION, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'UsersModule' => array('RIGHT_CHANGE_USER_PASSWORDS' => array('displayName' => UsersModule::RIGHT_CHANGE_USER_PASSWORDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_WEB' => array('displayName' => 'Sign in Via Web', 'explicit' => Right::DENY, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_MOBILE' => array('displayName' => 'Sign in Via Mobile', 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_WEB_API' => array('displayName' => 'Sign in Via Web API', 'explicit' => Right::ALLOW, 'inherited' => Right::ALLOW, 'effective' => Right::ALLOW), 'RIGHT_CREATE_USERS' => array('displayName' => UsersModule::RIGHT_CREATE_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_USERS' => array('displayName' => UsersModule::RIGHT_ACCESS_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MissionsModule' => array('RIGHT_CREATE_MISSIONS' => array('displayName' => MissionsModule::RIGHT_CREATE_MISSIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_MISSIONS' => array('displayName' => MissionsModule::RIGHT_DELETE_MISSIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_MISSIONS' => array('displayName' => MissionsModule::RIGHT_ACCESS_MISSIONS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ReportsModule' => array('RIGHT_CREATE_REPORTS' => array('displayName' => ReportsModule::RIGHT_CREATE_REPORTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_REPORTS' => array('displayName' => ReportsModule::RIGHT_DELETE_REPORTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_REPORTS' => array('displayName' => ReportsModule::RIGHT_ACCESS_REPORTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'WorkflowsModule' => array('RIGHT_CREATE_WORKFLOWS' => array('displayName' => WorkflowsModule::RIGHT_CREATE_WORKFLOWS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_WORKFLOWS' => array('displayName' => WorkflowsModule::RIGHT_DELETE_WORKFLOWS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_WORKFLOWS' => array('displayName' => WorkflowsModule::RIGHT_ACCESS_WORKFLOWS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'SocialItemsModule' => array('RIGHT_ACCESS_SOCIAL_ITEMS' => array('displayName' => 'Access Social Items', 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MarketingModule' => array('RIGHT_ACCESS_MARKETING' => array('displayName' => MarketingModule::RIGHT_ACCESS_MARKETING, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'EmailTemplatesModule' => array('RIGHT_CREATE_EMAIL_TEMPLATES' => array('displayName' => EmailTemplatesModule::RIGHT_CREATE_EMAIL_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_EMAIL_TEMPLATES' => array('displayName' => EmailTemplatesModule::RIGHT_DELETE_EMAIL_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_EMAIL_TEMPLATES' => array('displayName' => EmailTemplatesModule::RIGHT_ACCESS_EMAIL_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'MarketingListsModule' => array('RIGHT_CREATE_MARKETING_LISTS' => array('displayName' => MarketingListsModule::RIGHT_CREATE_MARKETING_LISTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_MARKETING_LISTS' => array('displayName' => MarketingListsModule::RIGHT_DELETE_MARKETING_LISTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_MARKETING_LISTS' => array('displayName' => MarketingListsModule::RIGHT_ACCESS_MARKETING_LISTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ProductTemplatesModule' => array('RIGHT_CREATE_PRODUCT_TEMPLATES' => array('displayName' => ProductTemplatesModule::RIGHT_CREATE_PRODUCT_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_PRODUCT_TEMPLATES' => array('displayName' => ProductTemplatesModule::RIGHT_DELETE_PRODUCT_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_PRODUCT_TEMPLATES' => array('displayName' => ProductTemplatesModule::RIGHT_ACCESS_PRODUCT_TEMPLATES, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)), 'ProductsModule' => array('RIGHT_CREATE_PRODUCTS' => array('displayName' => ProductsModule::RIGHT_CREATE_PRODUCTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_DELETE_PRODUCTS' => array('displayName' => ProductsModule::RIGHT_DELETE_PRODUCTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_PRODUCTS' => array('displayName' => ProductsModule::RIGHT_ACCESS_PRODUCTS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)));
     $data = RightsUtil::getAllModuleRightsDataByPermitable($group);
     $this->assertEquals($compareData, $data);
     $group->forget();
 }
コード例 #3
0
 public function actionSecurityDetails($id)
 {
     UserAccessUtil::resolveCanCurrentUserAccessAction(intval($id));
     $user = User::getById(intval($id));
     UserAccessUtil::resolveCanCurrentUserAccessRootUser($user);
     UserAccessUtil::resolveAccessingASystemUser($user);
     $title = Zurmo::t('UsersModule', 'Security Overview');
     $breadCrumbLinks = array(strval($user) => array('default/details', 'id' => $id), $title);
     $modulePermissionsData = PermissionsUtil::getAllModulePermissionsDataByPermitable($user);
     $modulePermissionsForm = ModulePermissionsFormUtil::makeFormFromPermissionsData($modulePermissionsData);
     $viewReadyModulePermissionsData = GroupModulePermissionsDataToEditViewAdapater::resolveData($modulePermissionsData);
     $modulePermissionsViewMetadata = ModulePermissionsActualDetailsViewUtil::resolveMetadataFromData($viewReadyModulePermissionsData, ModulePermissionsEditAndDetailsView::getMetadata());
     $rightsData = RightsUtil::getAllModuleRightsDataByPermitable($user);
     $rightsForm = RightsFormUtil::makeFormFromRightsData($rightsData);
     $rightsViewMetadata = RightsEffectiveDetailsViewUtil::resolveMetadataFromData($rightsData, RightsEditAndDetailsView::getMetadata());
     $policiesData = PoliciesUtil::getAllModulePoliciesDataByPermitable($user);
     $policiesForm = PoliciesFormUtil::makeFormFromPoliciesData($policiesData);
     $policiesViewMetadata = PoliciesEffectiveDetailsViewUtil::resolveMetadataFromData($policiesData, PoliciesEditAndDetailsView::getMetadata());
     $groupMembershipAdapter = new UserGroupMembershipToViewAdapter($user);
     $groupMembershipViewData = $groupMembershipAdapter->getViewData();
     $securityDetailsView = new UserActionBarAndSecurityDetailsView($this->getId(), $this->getModule()->getId(), $user, $modulePermissionsForm, $rightsForm, $policiesForm, $modulePermissionsViewMetadata, $rightsViewMetadata, $policiesViewMetadata, $groupMembershipViewData);
     $view = new UsersPageView($this->resolveZurmoDefaultOrAdminView($securityDetailsView, $breadCrumbLinks, 'UserBreadCrumbView'));
     echo $view->render();
 }
コード例 #4
0
 /**
  * @depends testRightsFormUtil
  */
 public function testRightsFormUtilSetRightsFromPost()
 {
     $group = Group::getByName('viewGroup');
     $data = RightsUtil::getAllModuleRightsDataByPermitable($group);
     $form = RightsFormUtil::makeFormFromRightsData($data);
     $compareData = array('UsersModule' => array('RIGHT_CHANGE_USER_PASSWORDS' => array('displayName' => UsersModule::RIGHT_CHANGE_USER_PASSWORDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_WEB' => array('displayName' => 'Sign in Via Web', 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_MOBILE' => array('displayName' => 'Sign in Via Mobile', 'explicit' => Right::ALLOW, 'inherited' => null, 'effective' => Right::ALLOW), 'RIGHT_LOGIN_VIA_WEB_API' => array('displayName' => 'Sign in Via Web API', 'explicit' => null, 'inherited' => Right::ALLOW, 'effective' => Right::ALLOW), 'RIGHT_CREATE_USERS' => array('displayName' => UsersModule::RIGHT_CREATE_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_USERS' => array('displayName' => UsersModule::RIGHT_ACCESS_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)));
     $this->assertEquals($compareData['UsersModule'], $form->data['UsersModule']);
     $fakePost = array('UsersModule__RIGHT_LOGIN_VIA_WEB_API' => strval(Right::ALLOW), 'UsersModule__RIGHT_LOGIN_VIA_MOBILE' => '', 'UsersModule__RIGHT_LOGIN_VIA_WEB' => strval(Right::DENY));
     $fakePost = RightsFormUtil::typeCastPostData($fakePost);
     $saved = RightsFormUtil::setRightsFromCastedPost($fakePost, $group);
     $this->assertTrue($saved);
     $group->forget();
     $group = Group::getByName('viewGroup');
     $compareData = array('UsersModule' => array('RIGHT_CHANGE_USER_PASSWORDS' => array('displayName' => UsersModule::RIGHT_CHANGE_USER_PASSWORDS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_WEB' => array('displayName' => 'Sign in Via Web', 'explicit' => Right::DENY, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_MOBILE' => array('displayName' => 'Sign in Via Mobile', 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_LOGIN_VIA_WEB_API' => array('displayName' => 'Sign in Via Web API', 'explicit' => Right::ALLOW, 'inherited' => Right::ALLOW, 'effective' => Right::ALLOW), 'RIGHT_CREATE_USERS' => array('displayName' => UsersModule::RIGHT_CREATE_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY), 'RIGHT_ACCESS_USERS' => array('displayName' => UsersModule::RIGHT_ACCESS_USERS, 'explicit' => null, 'inherited' => null, 'effective' => Right::DENY)));
     $data = RightsUtil::getAllModuleRightsDataByPermitable($group);
     $this->assertEquals($compareData['UsersModule'], $data['UsersModule']);
     $group->forget();
 }