Returns whether the currently signed-in user has *any* of the specified roles

@param int[] ...$roles the roles as constants from the {@see Role} class
@return bool

@see Role
499625
public function hasAnyRole(...$roles) {
		foreach ($roles as $role) {
			if ($this->hasRole($role)) {
				return true;
			}
		}

		return false;
	}
529590
public function hasRole($role) {
        $roles = (array) $this->Session->read('Acl.roles');

        if (is_numeric($role)) {
            return isset($roles[$role]);
        }

        return in_array($role, $roles);
    }
1318280
public function matchIdentityRoles(array $roles): bool
    {
        $identityRoles = $this->getIdentityRoles();
        // Too easy...
        if (empty($identityRoles)) {
            return false;
        }
        $roleNames = [];
        foreach ($roles as $role) {
            $roleNames[] = $role instanceof RoleInterface ? $role->getName() : (string)$role;
        }

        $identityRoleNames = [];
        foreach ($this->flattenRoles($identityRoles) as $role) {
            $identityRoleNames[] = $role->getName();
        }

        return count(array_intersect($roleNames, $identityRoleNames)) > 0;
    }
1290577
public function handle($roles)
    {
        if ($this->auth->check()) {
            return $this->auth->user()->hasRole($roles);
        }

        return false;
    }
1290240
public function hasRole($role)
    {
        $roles = $this->roles;
        foreach ($roles as $role_obj)
            if ($this->checkRole($role, $role_obj))
                return true;

        return false;
    }
388219
public function hasRole($role = "general")
	{
        $roleModel = new \erdiko\users\models\Role;
        $roleEntity = $roleModel->findByName($role);
        if (empty($roleEntity)) {
            throw  new \Exception("Error, role {$role} not found.");
        }
        $result = $this->_user->getRole() == $roleEntity->getId();

		return $result;
	}
377223
public static function hasRole($roles)
    {
        $user = wp_get_current_user();

        if (is_string($roles)) {
            $roles = array($roles);
        }

        if (!array_intersect($roles, $user->roles)) {
            return false;
        }

        return true;
    }
582569
public function hasOneRole($role)
    {
        foreach ($this->getArrayFrom($role) as $role) {
            if ($this->checkRole($role)) {
                return true;
            }
        }

        return false;
    }
807184
public function visible(array $roles = []) : bool
    {
        if (empty($roles)) {
            return true;
        }

        $roles = array_column($roles, 'slug');

        return $this->inRoles($roles) || $this->isAdministrator();
    }
67941
public function authorizeRoles($roles)
    {
        if (is_array($roles)) {
            return $this->hasAnyRole($roles) ||
                abort(401, 'This action is unauthorized.');
        }
        return $this->hasRole($roles) ||
            abort(401, 'This action is unauthorized.');
    }
1150665
public function hasRole($role)
    {
        if (is_string($role)) {
            return $this->roles->contains('slug', $role);
        }

        if (is_array($role)) {
            $roles = $this->getRoleSlugs();

            $intersection      = array_intersect($roles, (array) $role);
            $intersectionCount = count($intersection);

            return ($intersectionCount > 0) ? true : false;
        }

        return ! ! $role->intersect($this->roles)->count();
    }
241253
public function hasRole($role)
    {
        if ($this->instance instanceof \Phavour\Session\Storage) {
            $roles = $this->instance->get('roles');
            if (is_array($roles) && in_array($role, $roles)) {
                return true;
            }
        }

        return false;
    }
1288132
public function satisfiedByRoles(Roles $roles = null): bool
    {
        if (null === $roles) {
            return false;
        }

        if ($this->callbackAnnotatedWith->rolesAware()) {
            return true;
        }

        return $roles->contain($this->requiredRole());
    }
460109
public static function roleExists($role) : bool {
		if (empty($_SESSION['numbers']['user']['roles'])) return false;
		if (is_array($role)) {
			$temp = array_intersect($role, $_SESSION['numbers']['user']['roles']);
			return !empty($temp);
		} else {
			return in_array($role, $_SESSION['numbers']['user']['roles']);
		}
	}
1122280
public function hasRole(Role $role)
    {
        $role = !is_string($role) ?: Role::where(['name' => $role])->firstOrFail();

        if ($role) {
            foreach ($this->roles as $r) {
                if ($r->id == $role->id) {
                    return true;
                }
            }
        }

        return false;
    }
231319
public function hasRole($role = ''){

        $session = $this->getSession();
        $cookie = $this->getCookie();


        if ($cookie->has(self::USER_SESSION)) {
            $login = $cookie->get(self::USER_SESSION);
        }elseif (false !== $session->has(self::USER_SESSION)) {
            $login = $session->get(self::USER_SESSION);
        }else{
            return false;
        }

        $roleLogin = $login['role'];

        if (is_string($role)) {
            return $roleLogin === $role;
        }elseif(is_array($role)){
            return array_search($roleLogin, $role);
        }

        return false;
    }
525191
public function getAccessibleRoles(array $roles)
    {
        $accessibleRoles = $roles;
        foreach ($roles as $role) {
            /**
             * @var $role Role
             */
            if (isset($this->map[$role->getRole()])) {
                foreach ($this->map[$role->getRole()] as $r) {
                    $accessibleRoles[] = new Role($r);
                }
            }
        }

        return $accessibleRoles;
    }