public class AccessControl extends DBObject implements DependanceListener, ReloadEventListener
DBObject.DenormalizeAction
Modifier and Type | Field and Description |
---|---|
static GlobalId |
DBCLASS_GID
AccessControl is used to limit the user access to DBObjects, based on
the class and field values.
|
static java.lang.String |
DBCLASS_NAME
AccessControl is used to limit the user access to DBObjects, based on
the class and field values.
|
ATTRIBUTE_MARVIN, dbClass, ds, NO_LOOP_PARAMS
Constructor and Description |
---|
AccessControl(DBClass def,
DataSource dataSource)
Creates a new AccessControl object.
|
Modifier and Type | Method and Description |
---|---|
AccessControlClause |
addClause(java.lang.String fieldPath,
java.lang.String symbol,
java.lang.String value) |
protected void |
clearCache(GlobalKey changedKey)
Automatically called for eventDataLoaded() with this GlobalKey and getCleanVersion() with null for the global key.
|
static AccessControl |
create(MutableDataSource mds)
Make a new instance of this class.
|
protected void |
doDependentsChanged()
dependents have changed.
|
void |
eventDependantAdded(GlobalKey addedKey,
GlobalKey sourceFieldKey)
A record that points to this record was added.
|
void |
eventDependantRemoved(GlobalKey removedKey,
GlobalKey sourceFieldKey)
A record that points to this record was removed.
|
void |
eventReload(DBObject obj)
Called when a watched DBObject is reloaded, internally or externally.
|
protected void |
extAutoEnterCreate()
Extend this method to add functionality when a new DBObject is created.
You may need to create a FldParams, and setIsAutoEntered(true)
so that system does not misunderstand that this object is changed by user. |
protected void |
extPreValidate()
Make sure that we validate all clauses when we validate an ACL.
|
protected ValidationError |
extValidateField(DBField field,
ValidationList list)
Validates the fields of the restriction itself
|
protected void |
extValidateRecord(ValidationList list)
Performs additional validations on this record.
|
AccessGroup |
findAccessGroup(java.lang.String... args)
Access group that this ACL applies to.
|
static AccessControl |
findKey(DataSource ds,
int key)
Find the target for this class by the primary key
|
AccessGroup |
getAccessGroup(java.lang.String... args) |
DBClass |
getBaseClass()
Returns the base class for the restriction.
|
java.lang.String |
getDescription(java.lang.String... args) |
java.lang.String |
getFieldPathDescOld(java.lang.String... args)
Deprecated.
|
java.lang.String |
getFieldPathOld(java.lang.String... args)
Deprecated.
|
java.lang.String |
getFieldValueOld(java.lang.String... args)
Deprecated.
|
int |
getID(java.lang.String... args) |
java.lang.String |
getSymbolOld(java.lang.String... args)
Deprecated.
|
boolean |
isCreateFg(java.lang.String... args) |
boolean |
isDeleteFg(java.lang.String... args) |
boolean |
isFinalFg(java.lang.String... args) |
boolean |
isModifyFg(java.lang.String... args) |
boolean |
isOmitAllFg(java.lang.String... args) |
boolean |
isReadFg(java.lang.String... args) |
AccessControlClause[] |
listClauses()
A short hand method of checking the omit all flag.
|
static DBQuery<AccessControl> |
makeQuery(DataSource ds)
Make a new QUERY for this class.
|
boolean |
matches(DBObject obj)
Checks that the passed object is allowed by this restriction.
|
AccessControl |
setAccessGroup(com.aspc.dal.dbobj.acl.AccessGroup value,
java.lang.String... args) |
AccessControl |
setBaseClass(com.aspc.dal.dbobj.DBClass value,
java.lang.String... args) |
AccessControl |
setCreateFg(boolean value,
java.lang.String... args) |
AccessControl |
setDeleteFg(boolean value,
java.lang.String... args) |
AccessControl |
setDescription(java.lang.String value,
java.lang.String... args) |
AccessControl |
setFieldPathDescOld(java.lang.String value,
java.lang.String... args)
Deprecated.
|
AccessControl |
setFieldPathOld(java.lang.String value,
java.lang.String... args)
Deprecated.
|
AccessControl |
setFieldValueOld(java.lang.String value,
java.lang.String... args)
Deprecated.
|
AccessControl |
setFinalFg(boolean value,
java.lang.String... args) |
AccessControl |
setID(int value,
java.lang.String... args) |
AccessControl |
setModifyFg(boolean value,
java.lang.String... args) |
AccessControl |
setOmitAllFg(boolean value,
java.lang.String... args) |
AccessControl |
setReadFg(boolean value,
java.lang.String... args) |
AccessControl |
setSymbolOld(java.lang.String value,
java.lang.String... args)
Deprecated.
|
java.lang.String |
toString()
A simple description of the restriction
|
addReloadEventListener, archiveCheck, autoEnterCreate, calculateValue, calculateValue, calculateValue, callingRestoreByJournal, changeThreadMode, checkCreateAccess, checkDelete, checkDeleteAccess, checkModifyAccess, checkModifyAccess, checkReadAccess, copy, copyFields, copyIncludeField, copyInwardLinks, delete, denormalizedResult, displayLogName, displayName, displayValue, doSearch, dump, equals, eventDataLoaded, eventFieldUpdated, extCanDeleteDependantObject, extCheckCreateAccess, extCheckDeleteAccess, extCheckModifyAccess, extCheckModifyAccess, extCheckReadAccess, extCopy, extDelete, extDeleteRecord, extFixUp, extGetDerivedGlobalKey, extGetDerivedValue, extGetValue, extIsMandatory, extIsOnChange, extMarkSavePoint, extPostDeleteRecord, extPostSaveRecord, extPreDeleteRecord, extPreSaveRecord, extPreValidateDelete, extRaiseEvents, extRollbackTo, extSaveRecord, extSetValue, extUndelete, extValidateDelete, fetchLinkHolder, findGlobalKey, findGlobalKey, findGlobalKey, findGlobalKey, findLinkedObject, findLinkedObject, findLinkedObject, findRawData, fireEventDataLoaded, fixUp, forceLockedTransaction, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getChangedFieldInfo, getChangedFields, getDate, getDate, getDate, getDate, getDate, getDefaultValue, getDisableOnChangeEvent, getDouble, getDouble, getDouble, getDouble, getDouble, getFieldDouble, getFieldInt, getFieldLong, getFieldString, getFormattedString, getFormattedString, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getInt, getInt, getInt, getInt, getInt, getInt, getInwardLinkage, getKeyString, getKeyValue, getLinkedObject, getLinkedObject, getLinkedObject, getLinkedObjectByKey, getLinkedRowId, getLinkedRowId, getLinkedRowIdByData, getLinkHolder, getLockedTransaction, getLong, getLong, getLong, getLong, getLong, getLong, getMutableArrayValue, getMutableArrayValue, getOriginalKey, getOriginalValue, getOriginalValue, getProcessedValue, getPureValue, getRawData, getRawValue, getRawValue, getRowId, getRowKey, getSecondaryCacheGroupKey, getSrcLayerID, getString, getString, getString, getString, getString, getString, getValue, getValue, getValue, getValue, hasAutoChanged, hasAutoChanged, hasChanged, hasChangedByUser, hasChangedByUserField, hasChangedByUserField, hasFieldChanged, hasFieldChanged, hashCode, hasStoredResult, iCheckDeleteAccess, iCheckModifyAccess, iCheckReadAccess, iGetDenormalizedMap, iGetRawValue, iPlaceDenormalizedResult, iPostSaveOrDeleteRecord, iPreSaveOrDeleteRecord, iPreValidate, iRaiseEvents, iSaveOrDeleteRecord, isBrokenLink, isBrokenLink, isChanged, isDataCacheKnownToBeDirty, isDeleted, isEmpty, iSetValue, isForceReindex, isKeyWordField, isMandatory, isNew, isNull, isNull, isOnChange, isReindex, iValidateRecord, lastTouched, makeArchiveDataLoader, makeClone, makeDataLoader, makeDenormalizedDoc, makeLinkedArray, makeModifyAccessException, makeSearchPlan, makeWriteProvider, manualDenormalizeOnSave, markSavePoint, optLockedTransaction, registerWatchedObject, reindex, releaseDenormalized, removeReloadEventListener, restoreByJournal, rollbackTo, setBoolean, setBoolean, setBoolean, setBoolean, setDisableOnChangeEvent, setDouble, setDouble, setInt, setInt, setLong, setLong, setRawData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, touch, undelete, validateField, validateRecord, validateSubType
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
registerWatchedObject
public static final java.lang.String DBCLASS_NAME
public static final GlobalId DBCLASS_GID
public AccessControl(DBClass def, DataSource dataSource) throws java.lang.Exception
def
- The dbClass of the DBObjectdataSource
- The objects datasourcejava.lang.Exception
- A serious problem occurred@CheckReturnValue public int getID(java.lang.String... args)
@Nonnull public AccessControl setID(int value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public AccessGroup getAccessGroup(java.lang.String... args)
@CheckReturnValue @Nonnull public final AccessGroup findAccessGroup(java.lang.String... args) throws NotFoundException
AccessGroup
(String,
Mandatory, Searchable)args
- the optional argumentsNotFoundException
- AccessGroup was not found@Nonnull public AccessControl setAccessGroup(com.aspc.dal.dbobj.acl.AccessGroup value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Nonnull public AccessControl setBaseClass(com.aspc.dal.dbobj.DBClass value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isCreateFg(java.lang.String... args)
@Nonnull public AccessControl setCreateFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isDeleteFg(java.lang.String... args)
@Nonnull public AccessControl setDeleteFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getDescription(java.lang.String... args)
@Nonnull public AccessControl setDescription(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Deprecated @CheckReturnValue @Nonnull public java.lang.String getFieldPathDescOld(java.lang.String... args)
@Deprecated @Nonnull public AccessControl setFieldPathDescOld(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Deprecated @CheckReturnValue @Nonnull public java.lang.String getFieldPathOld(java.lang.String... args)
@Deprecated @Nonnull public AccessControl setFieldPathOld(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Deprecated @CheckReturnValue @Nonnull public java.lang.String getFieldValueOld(java.lang.String... args)
@Deprecated @Nonnull public AccessControl setFieldValueOld(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isFinalFg(java.lang.String... args)
@Nonnull public AccessControl setFinalFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isModifyFg(java.lang.String... args)
@Nonnull public AccessControl setModifyFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isOmitAllFg(java.lang.String... args)
@Nonnull public AccessControl setOmitAllFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isReadFg(java.lang.String... args)
@Nonnull public AccessControl setReadFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Deprecated @CheckReturnValue @Nonnull public java.lang.String getSymbolOld(java.lang.String... args)
@Deprecated @Nonnull public AccessControl setSymbolOld(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Nonnull @CheckReturnValue public static AccessControl create(@Nonnull MutableDataSource mds) throws java.lang.Exception
mds
- the datasourcejava.lang.Exception
- an object of this class could not be created@Nonnull @CheckReturnValue public static DBQuery<AccessControl> makeQuery(@Nonnull DataSource ds) throws NotFoundException
ds
- the datasourceNotFoundException
- if class could not be found@Nonnull @CheckReturnValue public static AccessControl findKey(@Nonnull DataSource ds, int key) throws NotFoundException, java.lang.Exception
ds
- the datasourcekey
- the valueNotFoundException
- if target could not be foundjava.lang.Exception
- a serious problem@OverridingMethodsMustInvokeSuper protected void extAutoEnterCreate() throws java.lang.Exception
DBObject
setIsAutoEntered(true)
so that system does not misunderstand that this object is changed by user.extAutoEnterCreate
in class DBObject
java.lang.Exception
- A serious problempublic void eventDependantAdded(GlobalKey addedKey, GlobalKey sourceFieldKey)
eventDependantAdded
in interface DependanceListener
addedKey
- The record's key that was added.sourceFieldKey
- Via which field is this object linked ?DependanceListener.eventDependantAdded( GlobalKey addedKey, GlobalKey sourceFieldKey)
public void eventDependantRemoved(GlobalKey removedKey, GlobalKey sourceFieldKey)
eventDependantRemoved
in interface DependanceListener
removedKey
- The record key that was removed.sourceFieldKey
- Via which field is this object linked ?DependanceListener.eventDependantRemoved( GlobalKey removedKey, GlobalKey sourceFieldKey)
@OverridingMethodsMustInvokeSuper protected void clearCache(@Nullable GlobalKey changedKey)
DBObject
clearCache
in class DBObject
changedKey
- The key that was changed.public void eventReload(@Nonnull DBObject obj)
eventReload
in interface ReloadEventListener
obj
- The object that was reloaded.@Nonnull public AccessControlClause addClause(java.lang.String fieldPath, java.lang.String symbol, java.lang.String value)
fieldPath
- the pathsymbol
- the symbolvalue
- the value@Nullable @CheckReturnValue public DBClass getBaseClass()
@CheckReturnValue @Nonnull public AccessControlClause[] listClauses()
@CheckReturnValue public boolean matches(@Nonnull DBObject obj) throws java.lang.Exception
obj
- The object to checkjava.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public java.lang.String toString()
@OverridingMethodsMustInvokeSuper protected void extPreValidate() throws java.lang.Exception
extPreValidate
in class DBObject
java.lang.Exception
- A serious problem@CheckReturnValue @OverridingMethodsMustInvokeSuper @Nullable protected ValidationError extValidateField(@Nonnull DBField field, @Nonnull ValidationList list) throws java.lang.Exception
extValidateField
in class DBObject
list
- The validation listfield
- The field to validatedjava.lang.Exception
- A serious problem@OverridingMethodsMustInvokeSuper protected void extValidateRecord(@Nonnull ValidationList list) throws java.lang.Exception
extValidateRecord
in class DBObject
list
- The validation list.java.lang.Exception
- A serious problemprotected void doDependentsChanged()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.