/** * * Loads all Roles for the Combobox in the filter. * Is only called when combo is opend first time * * @param sfWebRequest $request * @return <type> */ public function executeLoadAllRole(sfWebRequest $request) { $usermanagement = new Usermanagement(); $result = RoleTable::instance()->getAllRole(); $json_result = $usermanagement->buildRole($result,0); $this->renderText('({"result":'.json_encode($json_result).'})'); return sfView::NONE; }
/** * * Check if the user has sending rights * * @param int $mailinglistVersionId * @return boolean */ public function checkSendingRight($mailinglistVersionId) { $credentialId = CredentialTable::instance()->getCredentialIdByRight('workflow','workflowmanagement','sendWorkflow')->toArray(); $rightCheck = RoleTable::instance()->getRoleByRightAndRoleName($credentialId[0]['id'], $this->userroleName)->toArray(); if(empty($rightCheck) == true) { $result['allowedtosend'] = 0; return $result; } else { $sender = MailinglistAuthorizationSettingTable::instance()->getSettingsByType('senderwithrights', $mailinglistVersionId)->toArray(); $sender[0]['allowedtosend'] = 1; return $sender[0]; } }
/** * Load auth for editing template * * @param sfWebRequest $request * @return <type> */ public function executeLoadDefaultAuthorization(sfWebRequest $request) { $sysObj = new SystemSetting(); $auth = new MergeAuthorization(); $authorization = AuthorizationConfigurationTable::instance()->getAuthorizationConfiguration(false)->toArray(); $defaultRole = AuthorizationConfigurationTable::instance()->getAllRoles()->toArray(); $worklfosettings = $sysObj->buildAuthorizationColumns($authorization, $this->getContext()); $allRoles = RoleTable::instance()->getAllRole()->toArray(); $mergedRoles = $auth->mergeRoles($allRoles, $defaultRole, $worklfosettings); $this->renderText('{"result":'.json_encode($mergedRoles).'}'); return sfView::NONE; }
/** * Function checks, when user is trying to create a new userrole , if its * name is already stored in database. * When already stored, no save process is done. * * * @param sfWebRequest $request * @return <type> */ public function executeCheckForExistingRole(sfWebRequest $request) { $result = RoleTable::instance()->getRoleByDescription($request->getParameter('description')); if($result[0]->getDescription() == $request->getParameter('description')) { $this->renderText('0'); // no write access } else { $this->renderText('1'); // write access } return sfView::NONE; }