T
- as Tenant type, Example: Organization
U
- as SAASUser
for O typepublic abstract class VerifyShellAccessToTenantTransformer<T,U extends SAASUser<T>> extends Object implements VerifyAccessTransformer<UserShell<U,?>,T>
Shell
as a context to determine access to an Organization
.TenantContextJPAQueryTransformer
,
CurrentTenantSupplier
Constructor and Description |
---|
VerifyShellAccessToTenantTransformer() |
Modifier and Type | Method and Description |
---|---|
Collection<T> |
getAuthorizedUnits(U user)
Based on context or current user get the Units the current session/request has access to.
|
protected abstract String |
getTenantName(T tenant)
System wide unique name per tenant
|
boolean |
test(T unit)
Return true if authorized to access unit
If #getAuthorizedUnits() is null or
input is null then return false. |
Object |
transform(Object unit)
If a unit is authorized then return the input as is , else throw a
RuntimeException |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deriveContext
public VerifyShellAccessToTenantTransformer()
public Collection<T> getAuthorizedUnits(U user)
ThreadLocal
or some way to
tap into the session or request.public Object transform(Object unit)
VerifyAccessTransformer
RuntimeException
public boolean test(T unit)
VerifyAccessTransformer
#getAuthorizedUnits()
is null or
input is null then return false.Copyright © 2018. All rights reserved.