예제 #1
0
 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();
 }
예제 #2
0
 /**
  * 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;
     }
 }
예제 #3
0
 public function componentProjectPermissions()
 {
     $this->roles = TBGRole::getAll();
     $this->project_roles = TBGRole::getByProjectID($this->project->getID());
 }