Skip to content

class Athena::Security::Authorization::Strategy::Priority
inherits Reference #

Grants or denies the access based on the first voter that does not abstain, so the order of the voters decides which one overrules the others.

If all voters abstained, the decision is allow_if_all_abstain_decisions.

Included modules

Athena::Security::Authorization::Strategy::Interface

Constructors#

.new(allow_if_all_abstain_decisions : Bool = false)#

View source

Methods#

#decide(results : Iterator(ASEC::Authorization::Voter::Access), access_decision : ASEC::Authorization::AccessDecision | Nil = nil) : Bool#

Returns true if the access is granted based on the provided results, otherwise false.

The results are lazy: each voter only votes once its result is read, so a strategy can stop reading them as soon as its decision is known.

View source

#to_s(io : IO) : Nil#

Writes the name of this strategy to the provided io.

View source