Package net.pricefx.domain
Class UserGroup
Object
DomainObject
PersistedObject
PartitionedObject
NamedObject
UserGroup
- All Implemented Interfaces:
JobNameProvider
@Entity
public class UserGroup
extends NamedObject
A User Group (type code
UG) is a named group that Users and Business Roles can be assigned to. Find it with api.find("UG", Filter.equal("uniqueName", "Sales")). A User belongs to a group directly (see User.getGroups()) or through a Business Role (see User.getAllGroups()).
Objects such as Price Lists and Company Parameters tables store a User Group's unique name as plain text in their userGroupEdit and userGroupViewDetails fields. These fields restrict edit and view-details access to members of the group. A field can hold several group names separated by commas, so a unique name cannot contain a comma.
-
Nested Class Summary
Nested classes/interfaces inherited from class PersistedObject
PersistedObject.BatchDelete, PersistedObject.BulkloadFilterCheckCallback, PersistedObject.ComputedFieldMapping, PersistedObject.ComputedFields, PersistedObject.HardDelete, PersistedObject.ImportManagerEnabled, PersistedObject.PersistedObjectMeta, PersistedObject.VirtualField, PersistedObject.VirtualFieldMapping, PersistedObject.VirtualFields, PersistedObject.VirtualSearchFields, PersistedObject.VirtualSortFields -
Field Summary
FieldsFields inherited from class NamedObject
FIELD_LABEL, FIELD_UNIQUENAME, MAX_NAMED_FIELD_LENGTHFields inherited from class PartitionedObject
FIELD_PARTITION, FIELD_PARTITIONID, PARTITION_FILTER_NAME, PARTITION_FILTER_PARAMFields inherited from class PersistedObject
FIELD_CREATEDATE, FIELD_CREATEDBY, FIELD_DELETEDATE, FIELD_DELETEDBY, FIELD_ID, FIELD_ISDELETED, FIELD_LASTUPDATEBY, FIELD_LASTUPDATEDATE, FIELD_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauditOperation(AuditOperation operation, User byUser, CommandContext context, PersistedObjectService objService, String details) Records a security-relevant operation performed on this User Group (for exampleCREATE,UPDATEorDELETE) as aSecurityAuditTrailentry.Returns the first of four general-purpose extension fields on this User Group, with no built-in meaning.Returns the second of four general-purpose extension fields on this User Group, with no built-in meaning.Returns the third of four general-purpose extension fields on this User Group, with no built-in meaning.Returns the fourth of four general-purpose extension fields on this User Group, with no built-in meaning.booleanReturnstrue, so the server records a security audit entry when a User Group is created, updated or deleted through the standard data commands (seeauditOperation(AuditOperation, User, CommandContext, PersistedObjectService, String)).voidonDelete(PersistedObjectService pos, boolean hardDelete) Removes references to this User Group when it is deleted.voidsetAdditionalInfo1(BigDecimal additionalInfo1) Sets the first of four general-purpose extension fields on this User Group.voidsetAdditionalInfo2(BigDecimal additionalInfo2) Sets the second of four general-purpose extension fields on this User Group.voidsetAdditionalInfo3(String additionalInfo3) Sets the third of four general-purpose extension fields on this User Group.voidsetAdditionalInfo4(String additionalInfo4) Sets the fourth of four general-purpose extension fields on this User Group.booleanvalidate(ValidationVisitor validationVisitor, PersistedObjectService objService) Validates that this User Group's unique name does not contain a comma (its unique name is also used as a plain string, sometimes in a comma-separated list, onUserGroupRestrictedObjectentities), and thatgetAdditionalInfo3()andgetAdditionalInfo4()are at most 255 characters, in addition to the superclass's own validation.Methods inherited from class NamedObject
equals, getJobName, getLabel, getLabelOrUniqueName, getSignificantFields, getUniqueName, hashCode, labelValid, setLabel, setUniqueName, toString, truncateToMaxLength, uniqueNameValidMethods inherited from class PartitionedObject
addUniqueConstraint, getLoginNameByUserId, getPartition, setPartitionMethods inherited from class PersistedObject
bumpVersion, canAdd, canDelete, canEdit, canEdit, canRead, canReadElements, createDate, entityIsHardDeleted, entityIsMassDeletable, entityIsSafeInserted, entityIsSafeInserted, getBulkloadMap, getBusinessKey, getCreateDate, getCreatedBy, getDbColumnNameForField, getDeleteDate, getDeletedBy, getId, getLastUpdateBy, getLastUpdateDate, getSensitiveFields, getTypeCode, getTypedId, getVersion, getVirtualSearchFieldMappings, getVirtualSortFieldMappings, isDeleted, isHardDeleted, isVirtualSearchField, lastUpdateDate, notifyOnBusinessKeyChange, onBusinessKeyChange, onRefreshed, onSavedOrUpdated, onSaveOrUpdate, setCreateDate, setCreateDateShouldBeIgnored, setCreateDateTime, setCreatedBy, setDeleted, setDeleteDate, setDeletedBy, setId, setLastUpdateBy, setLastUpdateDate, setLastUpdateDateTime, setTypedId, setVersion, userGroupEditBulkloadFilter, userGroupEditBulkloadFilterMethods inherited from class DomainObject
deepCopy, getNewMidnightDate, getNewMidnightDateTime, isMidnight, isMidnight, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerializedSizeOK, jsonSerializeToBytes, jsonSerializeToBytes, setToDayEnd, setToDayEnd, setToMidnight, setToMidnight, setToMidnightAsLocalDateTime, toPropertyMap, truncatedToString
-
Field Details
-
CACHE_REGION_NAME
- See Also:
-
-
Constructor Details
-
UserGroup
public UserGroup()Creates an empty User Group.
-
-
Method Details
-
getAdditionalInfo1
Returns the first of four general-purpose extension fields on this User Group, with no built-in meaning.- Returns:
- the first extension field's value
-
setAdditionalInfo1
Sets the first of four general-purpose extension fields on this User Group.- Parameters:
additionalInfo1- the first extension field's value
-
getAdditionalInfo2
Returns the second of four general-purpose extension fields on this User Group, with no built-in meaning.- Returns:
- the second extension field's value
-
setAdditionalInfo2
Sets the second of four general-purpose extension fields on this User Group.- Parameters:
additionalInfo2- the second extension field's value
-
getAdditionalInfo3
Returns the third of four general-purpose extension fields on this User Group, with no built-in meaning. Limited to 255 characters (seevalidate(ValidationVisitor, PersistedObjectService)).- Returns:
- the third extension field's value
-
setAdditionalInfo3
Sets the third of four general-purpose extension fields on this User Group.- Parameters:
additionalInfo3- the third extension field's value
-
getAdditionalInfo4
Returns the fourth of four general-purpose extension fields on this User Group, with no built-in meaning. Limited to 255 characters (seevalidate(ValidationVisitor, PersistedObjectService)).- Returns:
- the fourth extension field's value
-
setAdditionalInfo4
Sets the fourth of four general-purpose extension fields on this User Group.- Parameters:
additionalInfo4- the fourth extension field's value
-
auditOperation
public void auditOperation(AuditOperation operation, User byUser, CommandContext context, PersistedObjectService objService, String details) Records a security-relevant operation performed on this User Group (for exampleCREATE,UPDATEorDELETE) as aSecurityAuditTrailentry.- Overrides:
auditOperationin classPersistedObject- Parameters:
operation- the operation performedbyUser- the user who performed itcontext- the request context the operation was performed inobjService- used to persist the audit trail entrydetails- additional details about the operation
-
isAudited
public boolean isAudited()Returnstrue, so the server records a security audit entry when a User Group is created, updated or deleted through the standard data commands (seeauditOperation(AuditOperation, User, CommandContext, PersistedObjectService, String)).- Overrides:
isAuditedin classPersistedObject- Returns:
- always
true
-
validate
public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService) Validates that this User Group's unique name does not contain a comma (its unique name is also used as a plain string, sometimes in a comma-separated list, onUserGroupRestrictedObjectentities), and thatgetAdditionalInfo3()andgetAdditionalInfo4()are at most 255 characters, in addition to the superclass's own validation. Records a validation error for the first problem found.- Overrides:
validatein classNamedObject- Parameters:
validationVisitor- collects validation errors; may benullobjService- used by the superclass's own validation- Returns:
trueif the unique name and extension fields are valid and the superclass validation also passed;falseotherwise
-
onDelete
public void onDelete(PersistedObjectService pos, boolean hardDelete) Removes references to this User Group when it is deleted. It removes the group from everyUserand Business Role and clears its unique name from theuserGroupEditanduserGroupViewDetailsfields of restricted objects in the current partition. It also deletes the Datamart data entitlements that reference the group. Fields that hold several comma-separated group names are not cleared, and read-only database views are skipped.When an already soft-deleted User Group is hard-deleted, only its Datamart data entitlements are removed.
- Overrides:
onDeletein classPersistedObject- Parameters:
pos- used to perform the cleanuphardDelete- whether this is a hard (permanent) delete rather than a soft delete
-