public class Authorizations extends Object
There are authorizations on these objects:
Geo services registry:
Application:
Authorizations are based on role names which are Group names.
Inheritence and authorization rules:
Group membership for a User is not cached and read from the database for the first authorization check in a Transaction. So authorization changes by an administrator should always be directly applied except authorization checks which use HttpServletRequest.isUserInRole(), which is cached by the servlet container. Currently only viewer-admin checks roles this way.
| Modifier and Type | Class and Description |
|---|---|
static class |
Authorizations.AppConfiguredComponentsReadersCache |
static class |
Authorizations.ApplicationCache |
static class |
Authorizations.GeoServiceCache |
static class |
Authorizations.Read |
static class |
Authorizations.ReadWrite |
| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
EVERYBODY
The empty set of role names which mean everybody has access.
|
static Set<String> |
NOBODY
The set of role names which mean nobody has access; a set which only contains
null.
|
static Map<Long,Authorizations.GeoServiceCache> |
serviceCache
Map of protected Layers per GeoService.
|
| Constructor and Description |
|---|
Authorizations() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkAppLayerReadAuthorized(Application app,
ApplicationLayer al,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static void |
checkAppLayerWriteAuthorized(Application app,
ApplicationLayer al,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static void |
checkConfiguredComponentAuthorized(ConfiguredComponent component,
javax.servlet.http.HttpServletRequest request) |
static void |
checkLayerReadAuthorized(Layer l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static void |
checkLayerWriteAuthorized(Layer l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static void |
checkLevelReadAuthorized(Application app,
Level l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static Authorizations.ApplicationCache |
getApplicationCache(Application app,
javax.persistence.EntityManager em) |
static Authorizations.ApplicationCache |
getApplicationCacheFromRequest(Application app,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static Authorizations.ReadWrite |
getLayerAuthorizations(Layer l,
javax.persistence.EntityManager em)
Returns set of authorized readers and writers for this layer.
|
static Set<String> |
getRoles(javax.servlet.http.HttpServletRequest request) |
static boolean |
isAppLayerReadAuthorized(Application app,
ApplicationLayer al,
javax.servlet.http.HttpServletRequest request,
Authorizations.ApplicationCache appCache,
javax.persistence.EntityManager em) |
static boolean |
isAppLayerReadAuthorized(Application app,
ApplicationLayer al,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static boolean |
isAppLayerWriteAuthorized(Application app,
ApplicationLayer al,
javax.servlet.http.HttpServletRequest request,
Authorizations.ApplicationCache appCache,
javax.persistence.EntityManager em) |
static boolean |
isAppLayerWriteAuthorized(Application app,
ApplicationLayer al,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static boolean |
isApplicationReadAuthorized(Application app,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static boolean |
isConfiguredComponentAuthorized(ConfiguredComponent component,
javax.servlet.http.HttpServletRequest request) |
static boolean |
isLayerGeomWriteAuthorized(Layer l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em)
See if a user can edit geometry attribute of a layer in addition to
regular writing.
|
static boolean |
isLayerReadAuthorized(Layer l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static boolean |
isLayerWriteAuthorized(Layer l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
static boolean |
isLevelReadAuthorized(Application app,
Level l,
javax.servlet.http.HttpServletRequest request,
Authorizations.ApplicationCache appCache,
javax.persistence.EntityManager em) |
static boolean |
isLevelReadAuthorized(Application app,
Level l,
javax.servlet.http.HttpServletRequest request,
javax.persistence.EntityManager em) |
public static final Set<String> NOBODY
public static final Set<String> EVERYBODY
public static final Map<Long,Authorizations.GeoServiceCache> serviceCache
public static boolean isLayerReadAuthorized(Layer l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static void checkLayerReadAuthorized(Layer l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em) throws Exception
Exceptionpublic static boolean isLayerWriteAuthorized(Layer l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static void checkLayerWriteAuthorized(Layer l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em) throws Exception
Exceptionpublic static boolean isLayerGeomWriteAuthorized(Layer l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
isAppLayerWriteAuthorized(nl.b3p.viewer.config.app.Application, nl.b3p.viewer.config.app.ApplicationLayer, javax.servlet.http.HttpServletRequest, javax.persistence.EntityManager)l - the layerrequest - the servlet request that has the user credentialem - the entity manager to usetrue if the user is allowed to edit the geometry
attribute of the layer (the user is not in any of the groups that prevent
editing geometry).public static Authorizations.ApplicationCache getApplicationCacheFromRequest(Application app, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static boolean isApplicationReadAuthorized(Application app, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static boolean isLevelReadAuthorized(Application app, Level l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static boolean isLevelReadAuthorized(Application app, Level l, javax.servlet.http.HttpServletRequest request, Authorizations.ApplicationCache appCache, javax.persistence.EntityManager em)
public static void checkLevelReadAuthorized(Application app, Level l, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em) throws Exception
Exceptionpublic static boolean isAppLayerReadAuthorized(Application app, ApplicationLayer al, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static boolean isAppLayerReadAuthorized(Application app, ApplicationLayer al, javax.servlet.http.HttpServletRequest request, Authorizations.ApplicationCache appCache, javax.persistence.EntityManager em)
public static void checkAppLayerReadAuthorized(Application app, ApplicationLayer al, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em) throws Exception
Exceptionpublic static boolean isAppLayerWriteAuthorized(Application app, ApplicationLayer al, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em)
public static boolean isAppLayerWriteAuthorized(Application app, ApplicationLayer al, javax.servlet.http.HttpServletRequest request, Authorizations.ApplicationCache appCache, javax.persistence.EntityManager em)
public static void checkAppLayerWriteAuthorized(Application app, ApplicationLayer al, javax.servlet.http.HttpServletRequest request, javax.persistence.EntityManager em) throws Exception
Exceptionpublic static boolean isConfiguredComponentAuthorized(ConfiguredComponent component, javax.servlet.http.HttpServletRequest request)
public static void checkConfiguredComponentAuthorized(ConfiguredComponent component, javax.servlet.http.HttpServletRequest request) throws Exception
Exceptionpublic static Authorizations.ReadWrite getLayerAuthorizations(Layer l, javax.persistence.EntityManager em)
l - the layer to checkem - the entity manager to usepublic static Authorizations.ApplicationCache getApplicationCache(Application app, javax.persistence.EntityManager em)
Copyright © 2017. All rights reserved.