-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathAssignRoleOnDataset.ts
More file actions
26 lines (23 loc) · 991 Bytes
/
AssignRoleOnDataset.ts
File metadata and controls
26 lines (23 loc) · 991 Bytes
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 { IDatasetsRepository } from '../repositories/IDatasetsRepository'
export class AssignRoleOnDataset implements UseCase<void> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Assigns a new role to someone on the given dataset.
*
* @param {number | string} [datasetId] - The dataset identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @param {string} [roleAssignee] - To whom the role should be assigned
* @param {string} [roleAlias] - The alias of the role to be assigned
* @returns {Promise<void>}
*/
async execute(
datasetId: number | string,
roleAssignee: string,
roleAlias: string
): Promise<void> {
return await this.datasetsRepository.assignRoleOnDataset(datasetId, roleAssignee, roleAlias)
}
}