forked from uncch-rdmc/dataverse-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetFileUserPermissions.ts
More file actions
21 lines (18 loc) · 908 Bytes
/
GetFileUserPermissions.ts
File metadata and controls
21 lines (18 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { IFilesRepository } from '../repositories/IFilesRepository'
import { FileUserPermissions } from '../models/FileUserPermissions'
export class GetFileUserPermissions implements UseCase<FileUserPermissions> {
private filesRepository: IFilesRepository
constructor(filesRepository: IFilesRepository) {
this.filesRepository = filesRepository
}
/**
* Returns a FileUserPermissions object, which includes the permissions that the calling user has on a particular File.
*
* @param {number | string} [fileId] - The file identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @returns {Promise<FileUserPermissions>}
*/
async execute(fileId: number | string): Promise<FileUserPermissions> {
return await this.filesRepository.getFileUserPermissions(fileId)
}
}