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 void
deleteAccess(FormRecordAccess access)
Deletes the given access from the database.String
getAccessDisplayName(FormRecordAccess access)
Returns the display name of the user associated with the given access.List<FormRecordAccess>
getAccesses()
Returns a list ofFormRecordAccess
for the current form record.String
getAccessGrantTypeTooltip(FormRecordAccess access)
UserViewModel
getAccessUser(FormRecordAccess access)
Returns aUserViewModel
for the given access.List<UserViewModel>
getAccessUsers()
Returns a list ofUserViewModel
for the current form record.boolean
hasAccesses()
Checks if the current form record has any accesses.boolean
isExpired(FormRecordAccess access)
Checks if the access is expired.boolean
isSubmitter(FormRecordAccess access)
Checks if the user is a submitter of the form record.String
toReadableDate(Instant instant)
Converts the given instant to a readable date string.void
updateData()
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 ofFormRecordAccess
for the current form record. The list is loaded from the database if it is null.- Returns:
- the list of
FormRecordAccess
for the current form record
-
getAccessUsers
public List<UserViewModel> getAccessUsers()
Returns a list ofUserViewModel
for the current form record. The list is loaded from the database if it is null.- Returns:
- the list of
UserViewModel
for the current form record and all users with access to it.
-
getAccessUser
public UserViewModel getAccessUser(FormRecordAccess access)
Returns aUserViewModel
for the given access. If the user is not found, it creates a newUserViewModel
with the access.- Parameters:
access
- the access to check- Returns:
- the
UserViewModel
for 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:IDataContainer
Should update data when called- Specified by:
updateData
in interfaceIDataContainer
-
-