Example #1
0
 /**
  * Operating with model via fudjan-api. Check if user has system
  * rights to do this. If not, then check team role rights.
  *
  * @param string       $method
  * @param \System\User $user
  * @return bool
  */
 public function can_be($method, \System\User $user)
 {
     $can_he = parent::can_be($method, $user);
     if (!$can_he && $this->team_home) {
         $team_members = get_all('Impro\\Team\\Member')->where(array("user" => $user->id, "team" => $this->team_home->id))->fetch_first();
         v($team_members);
         exit;
     }
     return $can_he;
 }