refactor: Adjust credential endpoints permissions (#4656) (no-changelog)

* refactor: Adjust credential endpoints permissions
This commit is contained in:
Omar Ajoue
2022-11-22 08:37:52 +01:00
committed by GitHub
parent fe0178150f
commit 4c423762d6
5 changed files with 76 additions and 20 deletions

View File

@@ -36,7 +36,7 @@ credentialsController.use('/', EECredentialsController);
credentialsController.get(
'/',
ResponseHelper.send(async (req: CredentialRequest.GetAll): Promise<ICredentialsResponse[]> => {
const credentials = await CredentialsService.getAll(req.user);
const credentials = await CredentialsService.getAll(req.user, { roles: ['owner'] });
return credentials.map((credential) => {
// eslint-disable-next-line no-param-reassign