Package nl.b3p.tailormap.api.security
Class AuthorizationService
- java.lang.Object
-
- nl.b3p.tailormap.api.security.AuthorizationService
-
@Service public class AuthorizationService extends Object
Validates access control rules. Any call to mayUserRead will verify that the currently logged in user is not only allowed to read the current object, but any object above and below it in the hierarchy.
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCESS_TYPE_READ
-
Constructor Summary
Constructors Constructor Description AuthorizationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowProxyAccess(Application application, GeoService geoService)To avoid exposing a secured service by proxying it to everyone, do not proxy a secured geo service when the application is public (accessible by anonymous users).booleanmayUserRead(Application application)Verifies that this user may read this Application.booleanmayUserRead(GeoService geoService)Verifies that this user may read this GeoService.booleanmayUserRead(GeoService geoService, GeoServiceLayer layer)Verifies that this user may read the Layer in context of the GeoService.
-
-
-
Field Detail
-
ACCESS_TYPE_READ
public static final String ACCESS_TYPE_READ
- See Also:
- Constant Field Values
-
-
Method Detail
-
mayUserRead
public boolean mayUserRead(Application application)
Verifies that this user may read this Application.- Parameters:
application- the Application to check- Returns:
- the results from the access control checks.
-
mayUserRead
public boolean mayUserRead(GeoService geoService)
Verifies that this user may read this GeoService.- Parameters:
geoService- the GeoService to check- Returns:
- the results from the access control checks.
-
mayUserRead
public boolean mayUserRead(GeoService geoService, GeoServiceLayer layer)
Verifies that this user may read the Layer in context of the GeoService.- Parameters:
geoService- the GeoService to checklayer- the GeoServiceLayer to check- Returns:
- the results from the access control checks.
-
allowProxyAccess
public boolean allowProxyAccess(Application application, GeoService geoService)
To avoid exposing a secured service by proxying it to everyone, do not proxy a secured geo service when the application is public (accessible by anonymous users). Do not even allow proxying a secured service if the user is logged viewing a public app!- Parameters:
application- The applicationgeoService- The geo service- Returns:
- Whether to allow proxying this service for the application
-
-