java.lang.Object
org.apache.jena.fuseki.auth.Auth
Authorization Policies.
See
Users
for special user names.-
Field Summary
Modifier and TypeFieldDescriptionstatic AuthPolicy
Any user, whether authenticated or not.static AuthPolicy
Any authenticated user.static AuthPolicy
Never allow.static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
allow
(String user, AuthPolicy policy) Test whether a user (principal) is allowed by a authorization policy.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.static AuthPolicy
policyAllowSpecific
(String... allowedUsers) A policy that allows specific users (convenience wrapped forpolicyAllowSpecific(Collection)
).static AuthPolicy
policyAllowSpecific
(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.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
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.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.
-