Interface SecurityKit

    • Field Detail

      • REQUIRE_AUTHORITY_METHOD

        static final java.lang.String REQUIRE_AUTHORITY_METHOD
        See Also:
        Constant Field Values
      • REQUIRE_PRINCIPAL_METHOD

        static final java.lang.String REQUIRE_PRINCIPAL_METHOD
        See Also:
        Constant Field Values
    • Method Detail

      • getPrincipal

        <P extends Principal> P getPrincipal()
        Returns active valid principal if it present.
        Returns:
        null if principal is invalid or absent.
      • setPrincipal

        void setPrincipal​(Principal principal)
      • hasAuthority

        boolean hasAuthority​(java.lang.String... authorityId)
        Check active principal for at least one valid authority.
        Parameters:
        authorityId -
        Returns:
        false if all are invalid
      • requirePrincipal

        default void requirePrincipal()
        Checks the presence of active valid principal. If not present - throws PrincipalRequiredException
      • requireAuthority

        default void requireAuthority​(java.lang.String... authorityId)
        For the active principal checks the presence of at least one valid authority. If there is not one - throws AuthorityRequiredException
        Parameters:
        authorityId -