-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathUnassignRoleOnCollection.ts
More file actions
26 lines (23 loc) · 1.14 KB
/
UnassignRoleOnCollection.ts
File metadata and controls
26 lines (23 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { ICollectionsRepository } from '../repositories/ICollectionsRepository'
import { ROOT_COLLECTION_ID } from '../models/Collection'
export class UnassignRoleOnCollection implements UseCase<void> {
private collectionsRepository: ICollectionsRepository
constructor(collectionsRepository: ICollectionsRepository) {
this.collectionsRepository = collectionsRepository
}
/**
* Deletes the given role assignment on the given Dataverse collection.
*
* @param {number | string} [collectionIdOrAlias = ':root'] - A generic collection identifier, which can be either a string (for queries by CollectionAlias), or a number (for queries by CollectionId)
* If this parameter is not set, the default value is: ':root'
* @param {number} [roleAssignmentId] - To numeric identifier of the role assignment
* @returns {Promise<void>}
*/
async execute(
collectionIdOrAlias: number | string = ROOT_COLLECTION_ID,
roleAssignmentId: number
): Promise<void> {
return await this.collectionsRepository.unassignRoleOnCollection(collectionIdOrAlias, roleAssignmentId)
}
}