public function inAllowedGroup()
    {
        if ($this->isCurrentUser() || (! $this->isStaff())) {
            // Always allow editing of non-staff user
            // for the time being
            return true;
        }

        $group  = $this->getGroupId();
        $groups = $this->util->getDbLookup()->getActiveStaffGroups();
        if (! isset($groups[$group])) {
            // Allow editing when the group does not exist or is no longer active.
            return true;
        }

        $allowedGroups = $this->userLoader->getCurrentUser()->getAllowedStaffGroups();
        if ($allowedGroups) {
            return (boolean) isset($allowedGroups[$group]);
        } else {
            return false;
        }
    }
public function inAllowedGroup()
    {
        if ($this->isCurrentUser() || (! $this->isStaff())) {
            // Always allow editing of non-staff user
            // for the time being
            return true;
        }

        $group  = $this->getGroupId();
        $groups = $this->util->getDbLookup()->getActiveStaffGroups();
        if (! isset($groups[$group])) {
            // Allow editing when the group does not exist or is no longer active.
            return true;
        }

        $allowedGroups = $this->userLoader->getCurrentUser()->getAllowedStaffGroups();
        if ($allowedGroups) {
            return (boolean) isset($allowedGroups[$group]);
        } else {
            return false;
        }
    }
public function inAllowedGroup ( ) { if ( $ this -> isCurrentUser ( ) || ( ! $ this -> isStaff ( ) ) ) { // Always allow editing of non-staff user // for the time being return true ; } $ group = $ this -> getGroupId ( ) ; $ groups = $ this -> util -> getDbLookup ( ) -> getActiveStaffGroups ( ) ; if ( ! isset ( $ groups [ $ group ] ) ) { // Allow editing when the group does not exist or is no longer active. return true ; } $ allowedGroups = $ this -> userLoader -> getCurrentUser ( ) -> getAllowedStaffGroups ( ) ; if ( $ allowedGroups ) { return ( boolean ) isset ( $ allowedGroups [ $ group ] ) ; } else { return false ; } }
Return true if this user has a role that is accessible by the current user,
i.e. is the current user allowed to change this specific user

@return boolean
Return true if this user has a role that is accessible by the current user i . e . is the current user allowed to change this specific user