-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathAuthorizer.java
More file actions
41 lines (34 loc) · 1.29 KB
/
Authorizer.java
File metadata and controls
41 lines (34 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* Copyright (c) restSQL Project Contributors. Licensed under MIT. */
package org.restsql.security;
import org.restsql.core.Request;
/**
* Authorizes restSQL requests.
*
* @author Mark Sawers
*/
public interface Authorizer {
/** Returns true if authorization is enabled. */
public boolean isAuthorizationEnabled();
/**
* Checks if user is assigned a role that may perform the request.
*
* @param context security context, usually container-provided
* @param request SQL Resource request
* @return true if user is authorized (or authorization is disabled), false otherwise
*/
public boolean isAuthorized(SecurityContext context, Request request);
/**
* Checks if user is assigned a role that may perform the request.
*
* @param context security context, usually container-provided
* @param requestType request type
* @param sqlResource SQL resource name
* @return true if user is authorized (or authorization is disabled), false otherwise
*/
public boolean isAuthorized(SecurityContext context, Request.Type requestType, String sqlResource);
/**
* Returns implementation configuration, e.g. data store location as well as a string representation of all roles
* and associated privileges.
*/
public String dumpConfig();
}