java.lang.Object
org.apache.jena.fuseki.auth.Auth
Authorization Policies.
See
Users for special user names.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic AuthPolicyAny user, whether authenticated or not.static AuthPolicyAny authenticated user.static AuthPolicyNever allow.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallow(String user, AuthPolicy policy) Test whether a user (principal) is allowed by a authorization policy.static booleanallow(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.static AuthPolicypolicyAllowSpecific(String... allowedUsers) A policy that allows specific users (convenience wrapped forpolicyAllowSpecific(Collection)).static AuthPolicypolicyAllowSpecific(Collection<String> allowedUsers) A policy that allows specific users.
-
Field Details
-
dftRealm
- See Also:
-
ANY_USER
Any authenticated user. -
ANY_ANON
Any user, whether authenticated or not. -
DENY_ALL
Never allow.
-
-
Constructor Details
-
Auth
public Auth()
-
-
Method Details
-
policyAllowSpecific
A policy that allows specific users (convenience wrapped forpolicyAllowSpecific(Collection)). -
policyAllowSpecific
A policy that allows specific users.- If any user is Users.UserDenyAll, then this policy is the same as DENY_ALL.
- If any user is Users.UserAnyLoggedIn, then this policy is the same as ANY_USER.
- If any user is Users.UserAnyAnon, then this policy is the same as ANY_ANON.
-
allow
Test whether a user (principal) is allowed by a authorization policy. The policy can be null, meaning no restrictions, and the function returns true.usermaybe null, meaning unauthenticated and any policy must deal with this.- Parameters:
user- Userpolicy- Policy- Returns:
- boolean True if the policy is null or allows the user.
-
allow
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 - seeallow(String, AuthPolicy). The policy can be null, meaning no restrictions, and the function returns true.usermaybe null, meaning unauthenticated and any policy must deal with this.- Parameters:
user- Userpolicy- PolicynotAllowed- Runnable to execute if the policy does not allow the user.
-