Interface SelfAuthorizer


  • public interface SelfAuthorizer
    Represents the ability (and responsibility) of an AdminCommand implementation to provide its own authorization logic, instead of relying on the command framework and the AccessRequired annotation to do so.

    Commands with complicated authorization requirements will implement this interface, in addition to the AdminCommand interface.

    Author:
    tjquinn
    • Method Detail

      • authorize

        void authorize​(Subject s,
                       Map<String,​Object> env)
        Tells whether the Subject is authorized to execute the AdminCommand which implements this interface.

        Note that the command framework will have injected parameter values into fields annotated with @Param before invoking this method, so the logic in isAuthorized can use those parameters in making its decision.

        Parameters:
        ctx - the AdminCommandContext for the current command execution