Interface Subject

All Known Subinterfaces:
Actor, Player, SessionOwner
All Known Implementing Classes:
AbstractNonPlayerActor, AbstractPlayerActor

public interface Subject
A subject has authorization attached to it.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkPermission(String permission)
    Check whether this subject has been granted the given permission and throw an exception on error.
    Get a list of groups that this subject is a part of.
    boolean
    hasPermission(String permission)
    Return whether this subject has the given permission.
  • Method Details

    • getGroups

      String[] getGroups()
      Get a list of groups that this subject is a part of.
      Returns:
      an array containing a group name per entry
    • checkPermission

      void checkPermission(String permission) throws AuthorizationException
      Check whether this subject has been granted the given permission and throw an exception on error.
      Parameters:
      permission - the permission
      Throws:
      AuthorizationException - thrown if not permitted
    • hasPermission

      boolean hasPermission(String permission)
      Return whether this subject has the given permission.
      Parameters:
      permission - the permission
      Returns:
      true if permission is granted