protected function detectRules(AppliesToResource $resource)
    {

        if (!$this->ruleDetector) {
            throw new UnConfiguredException("You have to assign a rule detector to detect rules");
        }

        return $this->ruleDetector->detectRules($resource, $this->relations);
    }