Gets the highest role of the member.
@return \CharlotteDunois\Yasmin\Models\Role
770330
function getHighestRole() {
        return $this->roles->reduce(function ($prev, $role) {
            if($prev === null) {
                return $role;
            }
            
            return ($role->comparePositionTo($prev) > 0 ? $role : $prev);
        });
    }
482935
public function getLevel()
    {
        if($this->level === null)
        {
            $this->level = count($this->getAncestors());
        }

        return $this->level;
    }
442253
public function moveHigher()
    {
        $higherItem = $this->higherItem();

        if ( ! $higherItem) return $this;

        $this->getConnection()->transaction(function() use ($higherItem) {

            $this->decrement($this->positionColumn());

            // Increment is not guaranteed to work with global scopes,
            $higherItem->{$this->positionColumn()} = $higherItem->{$this->positionColumn()} + 1;
            $higherItem->save();
        });

        return $this;
    }
517314
protected function getPermissionsRole()
    {
        $arguments = $this->getArguments();

        if (count($arguments) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $role_id = array_shift($arguments);

        if (!is_numeric($role_id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $role = $this->role->get($role_id);

        if (!isset($role['permissions'])) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($role_id, $role['permissions'], $arguments);
    }
1069773
function roles()
    {
        $groups = $this->attribute( 'groups' );
        $groups[] = $this->attribute( 'contentobject_id' );
        return eZRole::fetchByUser( $groups );
    }
1105231
public function getUserRoles() {
        $returnValue = $this->internalSession->getUserRoles();
        foreach (array_keys($returnValue) as $key) {
            $role = $returnValue[$key];
            if (!in_array($role, $this->filter)) {
                unset($returnValue[$key]);
            }
        }
        return $returnValue;
    }
801179
public function getterRoleConstants(): array
	{
		$result = [];
		$roles = $this->roles->get();
		/* @var $role AclRole */
		foreach ($roles as $role) {
			$result[] = $role->name;
		}
		return $result;
	}
828390
public function getBestTarget()
    {
        if ($this->hasParent() && ($this->target == '' || $this->target == '#')) {
            return $this->parent->getBestTarget();
        }
        
        return $this->target;
    }
795439
private function getTopNestingLevel()
    {
        $highestLevel = $this->getNestingLevel();
        foreach ($this->getChildren() as $child) {
            $childLevel = $child->getNestingLevel();
            if ($highestLevel < $childLevel) {
                $highestLevel = $childLevel;
            }
        }

        return $highestLevel;
    }
927663
public function getInheritanceList(): array
    {
        $roleList = [$this];
        $role = $this;
        while ($parentRole = $role->getParent()) {
            $roleList[] = $parentRole;
            $role = $parentRole;
        }

        return $roleList;
    }
833822
public function getCurrentRole() {
        $role = self::DEFAULT_VISITOR_ROLE;
        if ($this->isLoggedIn()) {
            $role = self::DEFAULT_USER_ROLE;
            $data = $this->getUserData();
            if (isset($data[self::ROLE_COLUMN])) {
                $role = $data[self::ROLE_COLUMN];
            }
        }
        return $role;
    }
981413
protected function getRolesWithPermission() {
    $roles_with_perm = [];

    /* @var \Drupal\user\RoleInterface[] $roles */
    $roles = Role::loadMultiple();

    // Check for each role which one has permission to "view inappropriate
    // reports".
    foreach ($roles as $role) {
      if ($role->hasPermission('view inappropriate reports')) {
        $roles_with_perm[] = $role->id();
      }
    }

    return $roles_with_perm;
  }
1191624
protected function _getRoleIds()
    {
        $ids = [];
        if (!$this->has('roles')) {
            return $ids;
        }
        foreach ($this->roles as $k => $role) {
            $ids[] = $role->id;
        }

        return $ids;
    }
957884
protected function getRoleSets()
    {
        return Util::getRoleSets($this->getUsername(), new String($this->lookupName), new String($this->rolesQuery), $this);
    }
1116771
protected function getListRole()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->role->getList(array('limit' => $this->getLimit()));
        }

        if (empty($id) || !is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->role->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
1302430
public function getUserRole() {
		return isset($_SESSION[$this->config->roleSessionVar]) ? $_SESSION[$this->config->roleSessionVar] : $this->config->defaultRole;
	}
273755
public function getRole()
	{
		if ($this->_user === NULL) {
			$this->_initUser();
		}

		if ($this->_user->getRole()) {
			return $this->_user->getRole();
		}

		return Acl::DEFAULT_ROLE;
	}