Package ome.security

Interface MethodSecurity

  • All Known Implementing Classes:
    BasicMethodSecurity

    public interface MethodSecurity
    Interface which allows security interceptors to check if a method should be executable for a given user. This determination is most likely based on RolesAllowed annotations and replaces the security provided by an application server.
    Since:
    3.0-Beta2
    See Also:
    SecuritySystem
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void checkMethod​(java.lang.Object obj, java.lang.reflect.Method method, ome.system.Principal principal, boolean hasPassword)
      Throws a SecurityViolation exception if the given Principal does not have the proper permissions to execute the given method.
      boolean isActive()
      Indicates whether or not method security is active.
    • Method Detail

      • isActive

        boolean isActive()
        Indicates whether or not method security is active. If not, then no further checks should be made, and implementations are free to throw exceptions if they are not properly initialized. Clients of this interface can assume that method-level security has been configured elsewhere.
        Returns:
        true if the other methods of this interface can and should be called.
      • checkMethod

        void checkMethod​(java.lang.Object obj,
                         java.lang.reflect.Method method,
                         ome.system.Principal principal,
                         boolean hasPassword)
                  throws ome.conditions.SecurityViolation
        Throws a SecurityViolation exception if the given Principal does not have the proper permissions to execute the given method. If isActive() returns false, this method may also throw any RuntimeException to specify that it is not in an active state.
        Parameters:
        obj - Object on which this method will be called.
        method - Method to be called.
        principal - Principal for which permissions will be checked.
        hasPassword - flag if the user's session has been authenticated directly and not via a one-time session id or similar.
        Throws:
        ome.conditions.SecurityViolation - if the given pr