mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Change the currentUserHasAccess flag behavior (no-changelog) (#4763)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user