fix: Change the currentUserHasAccess flag behavior (no-changelog) (#4763)

This commit is contained in:
Omar Ajoue
2022-11-29 15:54:24 +01:00
committed by GitHub
parent 92c77127d6
commit 47b9d22ed5
3 changed files with 5 additions and 5 deletions

View File

@@ -33,7 +33,7 @@ export class CredentialsService {
static async getAll(
user: User,
options?: { relations?: string[]; roles?: string[] },
options?: { relations?: string[]; roles?: string[]; disableGlobalRole?: boolean },
): Promise<ICredentialsDb[]> {
const SELECT_FIELDS: Array<keyof ICredentialsDb> = [
'id',
@@ -46,7 +46,7 @@ export class CredentialsService {
// if instance owner, return all credentials
if (user.globalRole.name === 'owner') {
if (user.globalRole.name === 'owner' && options?.disableGlobalRole !== true) {
return Db.collections.Credentials.find({
select: SELECT_FIELDS,
relations: options?.relations,