示例#1
0
 protected function canUserRemove($user)
 {
     $app = App::i();
     $agent_control = $app->isWorkflowEnabled() && $this->agent->canUser('@control', $user);
     if ($user->id == $this->agent->getOwnerUser()->id) {
         return true;
     } else {
         if ($this->hasControl) {
             return $this->owner->canUser('removeAgentRelationWithControl', $user) || $agent_control;
         } else {
             return $this->owner->canUser('removeAgentRelation', $user) || $agent_control;
         }
     }
 }
示例#2
0
 public function canUser($action, $userOrAgent = null)
 {
     return $this->owner->canUser($action, $userOrAgent);
 }