private function checkRoleHierarchyPermission($roleName, $permissionName, $role)
    {
        // Can current user manipulate role?
        if (is_string($role)) {
            $permissions = $this->app['config']->get("permissions/roles-hierarchy/$permissionName/$role", []);

            return in_array($roleName, $permissions);
        }

        // Can current user manipulate user?
        $user = $role;
        foreach ($user['roles'] as $role) {
            $permissions = $this->app['config']->get("permissions/roles-hierarchy/$permissionName/$role", []);
            if (in_array($roleName, $permissions)) {
                return true;
            }
        }

        return false;
    }
private function checkRoleHierarchyPermission($roleName, $permissionName, $role)
    {
        // Can current user manipulate role?
        if (is_string($role)) {
            $permissions = $this->app['config']->get("permissions/roles-hierarchy/$permissionName/$role", []);

            return in_array($roleName, $permissions);
        }

        // Can current user manipulate user?
        $user = $role;
        foreach ($user['roles'] as $role) {
            $permissions = $this->app['config']->get("permissions/roles-hierarchy/$permissionName/$role", []);
            if (in_array($roleName, $permissions)) {
                return true;
            }
        }

        return false;
    }
private function checkRoleHierarchyPermission ( $ roleName , $ permissionName , $ role ) { // Can current user manipulate role? if ( is_string ( $ role ) ) { $ permissions = $ this -> app [ 'config' ] -> get ( "permissions/roles-hierarchy/$permissionName/$role" , [ ] ) ; return in_array ( $ roleName , $ permissions ) ; } // Can current user manipulate user? $ user = $ role ; foreach ( $ user [ 'roles' ] as $ role ) { $ permissions = $ this -> app [ 'config' ] -> get ( "permissions/roles-hierarchy/$permissionName/$role" , [ ] ) ; if ( in_array ( $ roleName , $ permissions ) ) { return true ; } } return false ; }
Check if a hierarchy role has a sub-role.

@param string       $roleName
@param string       $permissionName
@param string|array $role

@return bool
Check if a hierarchy role has a sub - role .