resolver->inherit($user, 'parts_attachments', $attribute) ?? false; } } /** * Determines if the attribute and subject are supported by this voter. * * @param string $attribute An attribute * @param mixed $subject The subject to secure, e.g. an object the user wants to access or any other PHP type * * @return bool True if the attribute and subject are supported, false otherwise */ protected function supports($attribute, $subject) { if ($subject instanceof Attachment) { return in_array($attribute, $this->resolver->listOperationsForPermission('parts_attachments'), false); } return false; } }