Skip to content

class Athena::Security::Firewall::AccessListener
inherits Reference #

Denies the access to requests whose user is not granted the attribute that the ASEC::AccessMap requires for them, e.g. a role.

Runs after the other listeners of a firewall, once its user is authenticated. Raises an ASEC::Exception::AccessDenied to deny the access, which the ASEC::Firewall::ExceptionListener of the firewall handles.

Included modules

Athena::Security::Firewall::ListenerInterface

Constructors#

Methods#

#authenticate(event : AHK::Events::Request) : Nil#

Handles the request of the provided event, e.g. by authenticating its user.

Set a response on the event to send it, which prevents later listeners of the firewall from being called.

Raises an ASEC::Exception::AccessDenied if the user is not granted the attribute required for the request, which is the subject of the decision.

View source

#priority : Int32#

Returns the priority of this listener, listeners with a higher priority are called first.

View source

#supports?(request : AHTTP::Request) : Bool | Nil#

Returns true if #authenticate should be called for the provided request, otherwise false.

Returning nil also means that it should be called, but that it does not need to be before the token of the user is accessed.

Only returns true if the request requires an attribute other than ASEC::Authorization::Voter::Authenticated::PUBLIC_ACCESS.

View source