public function runConfigureRoles(TBGRequest $request) { if ($request->isPost()) { if (trim($request['role_name']) == '') { $this->getResponse()->setHttpStatus(400); return $this->renderJSON(array('error' => $this->getI18n()->__('You have to specify a name for this role'))); } $role = new TBGRole(); $role->setName($request['role_name']); $role->save(); return $this->renderJSON(array('content' => $this->getTemplateHTML('configuration/role', array('role' => $role)))); } $this->roles = TBGRole::getAll(); }
/** * Find users and show selection box * * @param TBGRequest $request The request object */ public function runFindAssignee(TBGRequest $request) { $this->forward403unless($request->isPost()); $this->message = false; if ($request['find_by']) { $this->selected_project = TBGContext::factory()->TBGProject($request['project_id']); $this->users = TBGUsersTable::getTable()->getByDetails($request['find_by'], 10); $this->teams = TBGTeamsTable::getTable()->quickfind($request['find_by']); $this->global_roles = TBGRole::getAll(); $this->project_roles = TBGRole::getByProjectID($this->selected_project->getID()); } else { $this->message = true; } }
public function componentProjectPermissions() { $this->roles = TBGRole::getAll(); $this->project_roles = TBGRole::getByProjectID($this->project->getID()); }