protected function resolveRestrictions($permissions, $action, Resource $resource)
    {
        foreach ($permissions as $permission) {
            // If we've found a matching restriction, return false.
            if ($permission instanceof Restriction && ! $permission->isAllowed($this, $action, $resource)) {
                return false;
            }
        }

        return true;
    }