/** * Retrieve an object without checking read permissions (i.e. value is used internally and not sent to others) * * @param fieldName the field name * @return Value */ protected Object getValueUnchecked(String fieldName) { requestScope.publishLifecycleEvent(this, CRUDEvent.CRUDAction.READ); requestScope.publishLifecycleEvent(this, fieldName, CRUDEvent.CRUDAction.READ, Optional.empty()); return getValue(getObject(), fieldName, requestScope); }
/** * Retrieve an object without checking read permissions (i.e. value is used internally and not sent to others) * * @param fieldName the field name * @return Value */ protected Object getValueUnchecked(String fieldName) { requestScope.publishLifecycleEvent(this, CRUDEvent.CRUDAction.READ); requestScope.publishLifecycleEvent(this, fieldName, CRUDEvent.CRUDAction.READ, Optional.empty()); return getValue(getObject(), fieldName, requestScope); }
/** * Gets a value from an entity and checks read permissions. * @param fieldName the field name * @return value value */ protected Object getValueChecked(String fieldName) { requestScope.publishLifecycleEvent(this, CRUDEvent.CRUDAction.READ); requestScope.publishLifecycleEvent(this, fieldName, CRUDEvent.CRUDAction.READ, Optional.empty()); checkFieldAwareDeferPermissions(ReadPermission.class, fieldName, (Object) null, (Object) null); return getValue(getObject(), fieldName, requestScope); }
/** * Gets a value from an entity and checks read permissions. * @param fieldName the field name * @return value value */ protected Object getValueChecked(String fieldName) { requestScope.publishLifecycleEvent(this, CRUDEvent.CRUDAction.READ); requestScope.publishLifecycleEvent(this, fieldName, CRUDEvent.CRUDAction.READ, Optional.empty()); checkFieldAwareDeferPermissions(ReadPermission.class, fieldName, (Object) null, (Object) null); return getValue(getObject(), fieldName, requestScope); }
/** * Queue the @*Update triggers iff this is not a newly created object (otherwise we run @*Create) */ private void triggerUpdate(String fieldName, Object original, Object value) { ChangeSpec changeSpec = new ChangeSpec(this, fieldName, original, value); boolean isNewlyCreated = requestScope.getNewPersistentResources().contains(this); CRUDEvent.CRUDAction action = isNewlyCreated ? CRUDEvent.CRUDAction.CREATE : CRUDEvent.CRUDAction.UPDATE; requestScope.publishLifecycleEvent(this, fieldName, action, Optional.of(changeSpec)); requestScope.publishLifecycleEvent(this, action); auditField(new ChangeSpec(this, fieldName, original, value)); }
/** * Queue the @*Update triggers iff this is not a newly created object (otherwise we run @*Create) */ private void triggerUpdate(String fieldName, Object original, Object value) { ChangeSpec changeSpec = new ChangeSpec(this, fieldName, original, value); boolean isNewlyCreated = requestScope.getNewPersistentResources().contains(this); CRUDEvent.CRUDAction action = isNewlyCreated ? CRUDEvent.CRUDAction.CREATE : CRUDEvent.CRUDAction.UPDATE; requestScope.publishLifecycleEvent(this, fieldName, action, Optional.of(changeSpec)); requestScope.publishLifecycleEvent(this, action); auditField(new ChangeSpec(this, fieldName, original, value)); }
requestScope.publishLifecycleEvent(newResource, CRUDEvent.CRUDAction.CREATE);
requestScope.publishLifecycleEvent(newResource, CRUDEvent.CRUDAction.CREATE);
requestScope.publishLifecycleEvent(this, CRUDEvent.CRUDAction.DELETE); requestScope.getDeletedResources().add(this);
requestScope.publishLifecycleEvent(this, CRUDEvent.CRUDAction.DELETE); requestScope.getDeletedResources().add(this);