Class Roles

    • Constructor Detail

      • Roles

        public Roles()
        Construct.
      • Roles

        public Roles​(String roles)
        Construct.
        Parameters:
        roles - Roles as a comma separated list, like "ADMIN, USER"
      • Roles

        public Roles​(String[] roles)
        Construct.
        Parameters:
        roles - Roles
    • Method Detail

      • hasRole

        public boolean hasRole​(String role)
        Whether this roles object containes the provided role.
        Parameters:
        role - the role to check
        Returns:
        true if it contains the role, false otherwise
      • hasAnyRole

        public boolean hasAnyRole​(Roles roles)
        Whether this roles object contains any of the provided roles.
        Parameters:
        roles - the roles to check
        Returns:
        true if it contains any of the roles, false otherwise
      • hasAllRoles

        public boolean hasAllRoles​(Roles roles)
        Whether this roles object contains all the provided roles.
        Parameters:
        roles - the roles to check
        Returns:
        true if it contains all the roles or the provided roles object is null, false otherwise