module Athena::Security::Authorization::Voter::Subject(T, A)
#
Implemented by voters that vote on subjects of type T, see ASEC::Authorization::Voter.
A is the type of the attributes the voter votes on: String, or an enum listing them.
With an enum, the voter only votes on its members, which are decided as strings like "PostVoter::Attribute::Edit", see ASEC::Authorization::Voter.attribute_name.
Its #supports? and #vote_on_attribute then receive the member, rather than the string.
The voter abstains unless it #supports? the attribute and subject, otherwise it grants the access if #vote_on_attribute returns true, and denies it if not.
Methods#
#vote(token : ASEC::Authentication::Token::Interface, subject : T, attribute : String, vote : ASEC::Authorization::Voter::Vote | Nil = nil) : ASEC::Authorization::Voter::Access#
Returns the vote of this voter on whether the provided token is granted the provided attribute on the provided subject.
The vote may be explained by adding reasons to the provided vote.