Skip to content

module Athena::Security::Authorization::CheckerInterface #

Checks whether the current user is granted an attribute, such as a role, optionally on a subject.

Direct including types

Athena::Security::Authorization::Checker

Methods#

abstract #granted?(attribute : String, subject = nil, access_decision : ASEC::Authorization::AccessDecision | Nil = nil) : Bool#

Returns true if the current user is granted the provided attribute, optionally on the provided subject, otherwise false.

The decision and the votes it was based on are stored in the provided access_decision, if any.

View source

#granted?(attribute : Enum, subject = nil, access_decision : ASEC::Authorization::AccessDecision | Nil = nil) : Bool#

Returns true if the current user is granted the provided attribute, a member of the attribute enum of a voter, optionally on the provided subject, otherwise false.

The attribute is decided as its ASEC::Authorization::Voter.attribute_name, see ASEC::Authorization::Voter::Subject(T, A).

View source