java.lang.Object
org.apache.jena.fuseki.auth.Auth

public class Auth extends Object
Authorization Policies. See Users for special user names.
  • Field Details

    • dftRealm

      public static final String dftRealm
      See Also:
    • ANY_USER

      public static AuthPolicy ANY_USER
      Any authenticated user.
    • ANY_ANON

      public static AuthPolicy ANY_ANON
      Any user, whether authenticated or not.
    • DENY_ALL

      public static AuthPolicy DENY_ALL
      Never allow.
  • Constructor Details

    • Auth

      public Auth()
  • Method Details

    • policyAllowSpecific

      public static AuthPolicy policyAllowSpecific(String... allowedUsers)
      A policy that allows specific users (convenience wrapped for policyAllowSpecific(Collection)).
    • policyAllowSpecific

      public static AuthPolicy policyAllowSpecific(Collection<String> allowedUsers)
      A policy that allows specific users.
    • allow

      public static boolean allow(String user, AuthPolicy policy)
      Test whether a user (principal) is allowed by a authorization policy. The policy can be null, meaning no restrictions, and the function returns true. user maybe null, meaning unauthenticated and any policy must deal with this.
      Parameters:
      user -
      policy -
      Returns:
      boolean True if the policy is null or allows the user.
    • allow

      public static boolean allow(String user, AuthPolicy policy, Runnable notAllowed)
      Test whether a user (principal) is allowed by a authorization policy and perform an action if the policy does not allow the user. The action can throw an exception. Additional, return true/false - see allow(String, AuthPolicy). The policy can be null, meaning no restrictions, and the function returns true. user maybe null, meaning unauthenticated and any policy must deal with this.
      Parameters:
      user -
      policy -
      notAllowed - Runnable to execute if the policy does not allow the user.