Package com.axelor.ai.db
Class AiRestriction
java.lang.Object
com.axelor.db.Model
com.axelor.auth.db.AuditableModel
com.axelor.ai.db.AiRestriction
What the AI may not read on one model, whatever the user's own permissions allow: the fields
listed, or, listing none, the whole model.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(AiRestrictionField item) Add the givenAiRestrictionFielditem to thefieldscollection.voidClear thefieldscollection.booleangetAttrs()The records hidden, as a permission's condition: a filter on self, with ? for each param.Comma-separated values for the condition's ?, as a permission's: __user__, __user__.group, …The fields the AI may neither read nor write.getId()A model's full or simple name, a package (com.axelor.sale.db.*), a custom model's name, or * for every model.inthashCode()voidRemove the givenAiRestrictionFielditem from thefieldscollection.voidvoidsetCondition(String condition) voidsetConditionParams(String conditionParams) voidsetFields(List<AiRestrictionField> fields) voidvoidvoidtoString()Methods inherited from class com.axelor.auth.db.AuditableModel
getCreatedBy, getCreatedOn, getUpdatedBy, getUpdatedOnMethods inherited from class com.axelor.db.Model
getArchived, getCid, getImportId, getVersion, isSelected, setArchived, setCid, setImportId, setSelected, setVersion
-
Constructor Details
-
AiRestriction
public AiRestriction()
-
-
Method Details
-
getId
-
setId
-
getPolicy
-
setPolicy
-
getObject
A model's full or simple name, a package (com.axelor.sale.db.*), a custom model's name, or * for every model.- Returns:
- the property value
-
setObject
-
getFields
The fields the AI may neither read nor write. None: the whole model is hidden.- Returns:
- the property value
-
setFields
-
addField
Add the givenAiRestrictionFielditem to thefieldscollection.It sets
item.restriction = thisto ensure the proper relationship.- Parameters:
item- the item to add
-
removeField
Remove the givenAiRestrictionFielditem from thefieldscollection.- Parameters:
item- the item to remove
-
clearFields
public void clearFields()Clear thefieldscollection. -
getCondition
The records hidden, as a permission's condition: a filter on self, with ? for each param. Empty: every record. Only when no fields are listed.- Returns:
- the property value
-
setCondition
-
getConditionParams
Comma-separated values for the condition's ?, as a permission's: __user__, __user__.group, …- Returns:
- the property value
-
setConditionParams
-
getAttrs
-
setAttrs
-
equals
-
hashCode
public int hashCode() -
toString
-