Package org.atmosphere.room.auth
Interface RoomAuthorizer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Authorizes room operations. Implementations decide whether a given
resource is allowed to perform an action in a room.
public class MyAuthorizer implements RoomAuthorizer {
@Override
public boolean authorize(AtmosphereResource resource, String roomName, RoomAction action) {
return resource.getRequest().isUserInRole("CHAT_USER");
}
}
- Since:
- 4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanauthorize(AtmosphereResource resource, String roomName, RoomAction action) Check if the resource is authorized to perform the action in the room.
-
Method Details
-
authorize
Check if the resource is authorized to perform the action in the room.- Parameters:
resource- the requesting resourceroomName- the target room nameaction- the action being attempted- Returns:
- true if authorized
-