Package de.xima.fc.inbox.bean
Class ProcessAccessBean
- java.lang.Object
-
- de.xima.fc.inbox.bean.ProcessAccessBean
-
- All Implemented Interfaces:
IDataContainer,Serializable
@ViewScoped @Named public class ProcessAccessBean extends Object implements Serializable, IDataContainer
- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProcessAccessBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteAccess(FormRecordAccess access)Deletes the given access from the database.StringgetAccessDisplayName(FormRecordAccess access)Returns the display name of the user associated with the given access.List<FormRecordAccess>getAccesses()Returns a list ofFormRecordAccessfor the current form record.StringgetAccessGrantTypeTooltip(FormRecordAccess access)UserViewModelgetAccessUser(FormRecordAccess access)Returns aUserViewModelfor the given access.List<UserViewModel>getAccessUsers()Returns a list ofUserViewModelfor the current form record.booleanhasAccesses()Checks if the current form record has any accesses.booleanisExpired(FormRecordAccess access)Checks if the access is expired.booleanisSubmitter(FormRecordAccess access)Checks if the user is a submitter of the form record.StringtoReadableDate(Instant instant)Converts the given instant to a readable date string.voidupdateData()Should update data when called
-
-
-
Method Detail
-
hasAccesses
public boolean hasAccesses()
Checks if the current form record has any accesses.- Returns:
- true if the form record has accesses, false otherwise
-
getAccesses
public List<FormRecordAccess> getAccesses()
Returns a list ofFormRecordAccessfor the current form record. The list is loaded from the database if it is null.- Returns:
- the list of
FormRecordAccessfor the current form record
-
getAccessUsers
public List<UserViewModel> getAccessUsers()
Returns a list ofUserViewModelfor the current form record. The list is loaded from the database if it is null.- Returns:
- the list of
UserViewModelfor the current form record and all users with access to it.
-
getAccessUser
public UserViewModel getAccessUser(FormRecordAccess access)
Returns aUserViewModelfor the given access. If the user is not found, it creates a newUserViewModelwith the access.- Parameters:
access- the access to check- Returns:
- the
UserViewModelfor the access
-
getAccessDisplayName
public String getAccessDisplayName(FormRecordAccess access)
Returns the display name of the user associated with the given access. If the user is not found or has no display name, it returns a default value.- Parameters:
access- the access to check- Returns:
- the display name of the user, or a default value if not found
-
deleteAccess
public void deleteAccess(FormRecordAccess access)
Deletes the given access from the database. This method is used to remove access rights for a user.- Parameters:
access- the access to delete
-
isExpired
public boolean isExpired(FormRecordAccess access)
Checks if the access is expired. An access is considered expired if the accessGrantedUntil field is not null and the current time is after the accessGrantedUntil time.- Parameters:
access- the access to check- Returns:
- true if the access is expired, false otherwise
-
toReadableDate
public String toReadableDate(Instant instant)
Converts the given instant to a readable date string.- Parameters:
instant- the instant to convert- Returns:
- the formatted date string, or an empty string if the instant is null
-
isSubmitter
public boolean isSubmitter(FormRecordAccess access)
Checks if the user is a submitter of the form record.- Parameters:
access- the access to check- Returns:
- true if the user's access grant type is REVIEW or PROVIDE , false otherwise
-
getAccessGrantTypeTooltip
public String getAccessGrantTypeTooltip(FormRecordAccess access)
- Parameters:
access- the access to check- Returns:
- Returns a tooltip string for the access grant type of the given access.
-
updateData
public void updateData()
Description copied from interface:IDataContainerShould update data when called- Specified by:
updateDatain interfaceIDataContainer
-
-