Interface DocumentRoleService
- All Superinterfaces:
Service
DocumentRole
s.-
Method Summary
Modifier and TypeMethodDescriptionbatchAssignMissingUsers
(List<DocumentVersion> documentVersions, String roleName, List<String> userIds) Creates an operation which can be used to update document roles such that all of the given user IDs are on the given document lifecycle role on all of the given documents.batchUpdateDocumentRoles
(List<DocumentRoleUpdate> documentRoleUpdates) Creates an operation which can be used to update document roles.getDocumentRoles
(List<DocumentVersion> documentVersions, String roleName) Retrieves aGetDocumentRolesResponse
object, which can be used to retrieve any manually assignedDocumentRole
s for a given document.getGroupInDocumentRoles
(Group group, List<DocumentRole> documentRoles) For the given group, returns aGetGroupInDocumentRolesResponse
which can be used to check if the group is in a particular document role.getMissingAssignments
(List<DocumentVersion> documentVersions, String roleName, List<String> userIds) Retrieves aGetMissingAssignmentsDocumentResponse
which can be used to check for an incompleteness of document roles.getUserInDocumentRoles
(String userId, List<DocumentRole> documentRoles) For a givenuserId
, retrieves aGetUserInDocumentRolesResponse
which can be used to check if the user is in a particular document role.newDocumentRoleUpdate
(String roleName, DocumentVersion documentVersion) Creates aDocumentRoleUpdate
which can be submitted tobatchUpdateDocumentRoles(List)
to update document roles on a particular document.
-
Method Details
-
getDocumentRoles
Retrieves aGetDocumentRolesResponse
object, which can be used to retrieve any manually assignedDocumentRole
s for a given document.The given roleName must be a valid option on each included
DocumentVersion
.- Parameters:
documentVersions
- List ofDocumentVersion
s to retrieve roles from. Cannot exceed 500DocumentVersion
s.roleName
- name of a document lifecycle role, for example,approver__c
- Returns:
- a
GetDocumentRolesResponse
object, which can be used to retrieve roles from the List ofDocumentVersion
s
-
getUserInDocumentRoles
GetUserInDocumentRolesResponse getUserInDocumentRoles(String userId, List<DocumentRole> documentRoles) For a givenuserId
, retrieves aGetUserInDocumentRolesResponse
which can be used to check if the user is in a particular document role.While a
GetDocumentRolesResponse
only contains manual assignments, this method will allow you to check if a user is in a document role from manual or automated assignments (such as Dynamic Access Control). In addition, this method will check if the user is in a document role indirectly, such as through a group.- Parameters:
userId
- the ID for a user. Cannot be null.documentRoles
- List ofDocumentRole
s. Cannot be null or exceed 500DocumentRole
s.- Returns:
- a
GetUserInDocumentRolesResponse
object, which can be used to retrieve users in the givenDocumentRole
s
-
getGroupInDocumentRoles
GetGroupInDocumentRolesResponse getGroupInDocumentRoles(Group group, List<DocumentRole> documentRoles) For the given group, returns aGetGroupInDocumentRolesResponse
which can be used to check if the group is in a particular document role.While a
GetDocumentRolesResponse
only contains direct manual assignments, this method will allow you to check if a group is in a document role from manual or automated assignments.- Parameters:
group
- a Group object. Cannot be null.documentRoles
- List of document roles to check. Cannot be null or exceed 500DocumentRole
s.- Returns:
- the
GetGroupInDocumentRolesResponse
object, which can be used to check if the group is in theDocumentRole
-
newDocumentRoleUpdate
Creates aDocumentRoleUpdate
which can be submitted tobatchUpdateDocumentRoles(List)
to update document roles on a particular document.- Parameters:
roleName
- name of a document lifecycle role, for example,approver__v
documentVersion
- a document to update roles on- Returns:
- a
DocumentRoleUpdate
instance which can be submitted tobatchUpdateDocumentRoles(List)
to update document roles on a document
-
batchUpdateDocumentRoles
BatchOperation<Void,BatchOperationError> batchUpdateDocumentRoles(List<DocumentRoleUpdate> documentRoleUpdates) Creates an operation which can be used to update document roles.The way that errors are handled can be specified on the returned
BatchOperation
. Once error-handling has been specified, the methodBatchOperation.execute()
must be called to finally execute the update. For example:documentRoleService.batchUpdateDocumentRoles(documentRoleUpdates).rollbackOnErrors().execute()
- Parameters:
documentRoleUpdates
- a List ofDocumentRoleUpdate
s to update. Cannot be null or exceed 500DocumentRoleUpdate
s.- Returns:
- an operation which can be used to update document roles
-
getMissingAssignments
GetMissingAssignmentsDocumentResponse getMissingAssignments(List<DocumentVersion> documentVersions, String roleName, List<String> userIds) Retrieves aGetMissingAssignmentsDocumentResponse
which can be used to check for an incompleteness of document roles.The given roleName must be a valid option on each included
DocumentVersion
.- Parameters:
documentVersions
- a List ofDocumentVersion
s to check. Cannot be null or exceed 500 documents.roleName
- name of a document lifecycle role, for example,approver__c
userIds
- a List of user IDs. Cannot be null or exceed 500 IDs.- Returns:
GetMissingAssignmentsDocumentResponse
object which can be used to check for incompleteness of document roles
-
batchAssignMissingUsers
BatchOperation<Void,BatchOperationError> batchAssignMissingUsers(List<DocumentVersion> documentVersions, String roleName, List<String> userIds) Creates an operation which can be used to update document roles such that all of the given user IDs are on the given document lifecycle role on all of the given documents.The given roleName must be a valid option on each included
DocumentVersion
.The way that errors are handled can be specified on the returned
BatchOperation
. Once error-handling has been specified, the methodBatchOperation.execute()
must be called to finally execute the update. For example:documentRoleService.batchUpdateDocumentRoles(documentRoleUpdates).rollbackOnErrors().execute()
- Parameters:
documentVersions
- a List of document versions. Cannot be null or exceed 500DocumentVersion
s.roleName
- name of a document lifecycle role, for example,approver__v
userIds
- a List of user IDs. Cannot be null or exceed 500 IDs.- Returns:
- an operation which can be used to update document roles
-