io.muserver.rest.Authorizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mu-server Show documentation
Show all versions of mu-server Show documentation
A simple but powerful web server framework
package io.muserver.rest;
import java.security.Principal;
/**
* A class that can check if a principle is in a given role.
* @see BasicAuthSecurityFilter
*/
public interface Authorizer {
/**
* Checks if a user is in a role
* @param principal The user, which was created by {@link UserPassAuthenticator#authenticate(String, String)}
* @param role A role to check
* @return Returns true if the user is in the given role; otherwise false.
*/
boolean isInRole(Principal principal, String role);
}