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.

@FunctionalInterface public interface RoomAuthorizer
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 Type
    Method
    Description
    boolean
    authorize(AtmosphereResource resource, String roomName, RoomAction action)
    Check if the resource is authorized to perform the action in the room.
  • Method Details

    • authorize

      boolean authorize(AtmosphereResource resource, String roomName, RoomAction action)
      Check if the resource is authorized to perform the action in the room.
      Parameters:
      resource - the requesting resource
      roomName - the target room name
      action - the action being attempted
      Returns:
      true if authorized