Class SecurityHelper
java.lang.Object
org.glassfish.jersey.message.filtering.SecurityHelper
Utility methods for security Entity Data Filtering.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFilteringScopes
(Annotation[] annotations) Get entity-filtering scopes of security annotations present among given annotations.getFilteringScopes
(javax.ws.rs.core.SecurityContext securityContext, Annotation[] annotations) Get entity-filtering scopes of security annotations present among given annotations with respect to givenSecurityContext
.Get authorization roles that has been derived from examining entity classes.(package private) static String
getRolesAllowedScope
(String role) Get entity-filtering scope forRolesAllowed
s role.
-
Field Details
-
roles
-
-
Constructor Details
-
SecurityHelper
private SecurityHelper()Prevent instantiation.
-
-
Method Details
-
getFilteringScopes
Get entity-filtering scopes of security annotations present among given annotations.A scope look like:
- <fully qualified annotation class name>, or
- <fully qualified annotation class name>_<role>
- Parameters:
annotations
- a list of annotations (doesn't need to contain only security annotations)- Returns:
- a set of entity-filtering scopes.
-
getFilteringScopes
static Set<String> getFilteringScopes(javax.ws.rs.core.SecurityContext securityContext, Annotation[] annotations) Get entity-filtering scopes of security annotations present among given annotations with respect to givenSecurityContext
. Resulting set contains only scopes that pass the security context check.A scope look like:
- <fully qualified annotation class name>, or
- <fully qualified annotation class name>_<role>
- Parameters:
securityContext
- security context to check whether a user is in specified logical role.annotations
- a list of annotations (doesn't need to contain only security annotations)- Returns:
- a set of entity-filtering scopes.
-
getRolesAllowedScope
Get entity-filtering scope forRolesAllowed
s role.- Parameters:
role
- role to retrieve entity-filtering scope for.- Returns:
- entity-filtering scope.
-
getProcessedRoles
Get authorization roles that has been derived from examining entity classes.- Returns:
- already processed authorization roles.
-