Interface IRoleCheckingStrategy

  • All Known Implementing Classes:
    AuthenticatedWebApplication
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface IRoleCheckingStrategy
    Strategy for doing role checking. Normally, an implementation of this strategy interface would look in the current session for credentials that indicate what roles the current user can take on, but any kind of strategy is possible. For example, you could have a role checking strategy that allowed gave users the ADMIN role between 9AM and 5PM.
    Author:
    Eelco Hillenius, Jonathan Locke
    • Method Detail

      • hasAnyRole

        boolean hasAnyRole​(Roles roles)
        Whether any of the given roles matches. For example, if a user has role USER and the provided roles are {USER, ADMIN} this method should return true as the user has at least one of the roles that were provided.
        Parameters:
        roles - the roles
        Returns:
        true if a user or whatever subject this implementation wants to work with has at least on of the provided roles