$attribute has format name.edit if (false !== strpos($attribute, '.')) { [$perm, $op] = explode('.', $attribute); return $this->resolver->isValidOperation('parts_'.$perm, $op); } return $this->resolver->isValidOperation('parts', $attribute); } return false; } protected function voteOnUser($attribute, $subject, User $user): bool { if ($subject instanceof Part) { //Check for sub permissions if (false !== strpos($attribute, '.')) { [$perm, $op] = explode('.', $attribute); return $this->resolver->inherit($user, 'parts_'.$perm, $op) ?? false; } //Null concealing operator means, that no return $this->resolver->inherit($user, 'parts', $attribute) ?? false; } //Deny access by default. return false; } }