Class FieldSecurityEnforcer
java.lang.Object
com.gigaspaces.internal.server.space.security.FieldSecurityEnforcer
Enforces field level security on properties marked as personal data (PII) - see
SpacePii.
A user lacking SpaceAuthority.SpacePrivilege.READ_PII on a PII property:
- gets the property value omitted (nullified) from results
- gets an
AccessDeniedExceptionwhen projecting or querying on the property
SpaceAuthority.SpacePrivilege.WRITE_PII on a PII property gets an AccessDeniedException
when writing a non-null value to it. On update, the existing value of such a property is preserved.- Since:
- 18.0.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe PII privileges of a specific user, with per type caching of the denied properties. -
Constructor Summary
ConstructorsConstructorDescriptionFieldSecurityEnforcer(SecurityInterceptor securityInterceptor, String spaceName) -
Method Summary
Modifier and TypeMethodDescriptionstatic BitSetcollectReferencedProperties(ITypeDesc typeDesc, ITemplatePacket template) Collects the positions of the fixed properties referenced by the template - either by its query conditions or by its explicit projection.static booleanholdsEntries(Object result) voidpreserveOnUpdate(SecurityContext securityContext, ITypeDesc typeDesc, IEntryData originalData, IEntryData newData) On update, preserves the existing values of PII properties the user is not allowed to write (which are necessarily null in the new values, seeFieldSecurityEnforcer.PiiAccess.assertWriteAllowed(ITypeDesc, IEntryPacket)).resolve(SecurityContext securityContext, boolean unwrapTrust) Resolves the PII access of the user behind the security context.static StringrootProperty(String path) voidvalidatePacketOperation(SecurityContext securityContext, SpaceAuthority.SpacePrivilege privilege, ITransportPacket packet, ITypeDesc typeDesc) Validates the specified packet operation does not access PII properties the user lacks privileges for.
-
Constructor Details
-
FieldSecurityEnforcer
-
-
Method Details
-
resolve
public FieldSecurityEnforcer.PiiAccess resolve(SecurityContext securityContext, boolean unwrapTrust) Resolves the PII access of the user behind the security context.- Parameters:
unwrapTrust- if true, a trusted (task) context is resolved to the user it was handed to.- Returns:
- the access, or
FieldSecurityEnforcer.PiiAccess.FULLif the context has full access.
-
validatePacketOperation
public void validatePacketOperation(SecurityContext securityContext, SpaceAuthority.SpacePrivilege privilege, ITransportPacket packet, ITypeDesc typeDesc) Validates the specified packet operation does not access PII properties the user lacks privileges for. -
preserveOnUpdate
public void preserveOnUpdate(SecurityContext securityContext, ITypeDesc typeDesc, IEntryData originalData, IEntryData newData) On update, preserves the existing values of PII properties the user is not allowed to write (which are necessarily null in the new values, seeFieldSecurityEnforcer.PiiAccess.assertWriteAllowed(ITypeDesc, IEntryPacket)). -
holdsEntries
- Returns:
- true if the operation result holds entries which may need masking - see
FieldSecurityEnforcer.PiiAccess.maskResults(Object, Function).
-
collectReferencedProperties
Collects the positions of the fixed properties referenced by the template - either by its query conditions or by its explicit projection. -
rootProperty
-