currentUserHaveMoreRightThan() static public method

Is the current user have more right than all profiles in parameters
static public currentUserHaveMoreRightThan ( $IDs = [] ) : boolean
$IDs array of profile ID to test
return boolean true if have more right
Exemplo n.º 1
0
 /**
  * Is the specified user have more right than the current one ?
  *
  * @param $ID  integer : Id of the user
  *
  * @return boolean : true if currrent user have the same right or more right
  **/
 function currentUserHaveMoreRightThan($ID)
 {
     $user_prof = Profile_User::getUserProfiles($ID);
     return Profile::currentUserHaveMoreRightThan($user_prof);
 }
Exemplo n.º 2
0
 function canCreateItem()
 {
     $user = new User();
     return $user->can($this->fields['users_id'], READ) && Profile::currentUserHaveMoreRightThan(array($this->fields['profiles_id'] => $this->fields['profiles_id'])) && Session::haveAccessToEntity($this->fields['entities_id']);
 }