refactor: Replace marketplace interface config with permission-based system

- Add MARKETPLACE permission type to handle marketplace access control
  - Update interface configuration to use role-based marketplace settings (admin/user)
  - Replace direct marketplace boolean config with permission-based checks
  - Modify frontend components to use marketplace permissions instead of interface config
  - Update agent query hooks to use marketplace permissions for determining permission levels
  - Add marketplace configuration structure similar to peoplePicker in YAML config
  - Backend now sets MARKETPLACE permissions based on interface configuration
  - When marketplace enabled: users get agents with EDIT permissions in dropdown lists  (builder mode)
  - When marketplace disabled: users get agents with VIEW permissions  in dropdown lists (browse mode)
This commit is contained in:
Atef Bellaaj 2025-07-01 17:46:07 +02:00 committed by Danny Avila
parent ce3dbf8609
commit f20209ecc5
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
12 changed files with 128 additions and 15 deletions

View file

@ -43,6 +43,9 @@ const rolePermissionsSchema = new Schema(
[Permissions.VIEW_USERS]: { type: Boolean, default: false },
[Permissions.VIEW_GROUPS]: { type: Boolean, default: false },
},
[PermissionTypes.MARKETPLACE]: {
[Permissions.USE]: { type: Boolean, default: false },
},
[PermissionTypes.FILE_SEARCH]: {
[Permissions.USE]: { type: Boolean, default: true },
},
@ -80,6 +83,7 @@ const roleSchema: Schema<IRole> = new Schema({
[Permissions.VIEW_USERS]: false,
[Permissions.VIEW_GROUPS]: false,
},
[PermissionTypes.MARKETPLACE]: { [Permissions.USE]: false },
[PermissionTypes.FILE_SEARCH]: { [Permissions.USE]: true },
}),
},

View file

@ -39,6 +39,9 @@ export interface IRole extends Document {
[Permissions.VIEW_USERS]?: boolean;
[Permissions.VIEW_GROUPS]?: boolean;
};
[PermissionTypes.MARKETPLACE]?: {
[Permissions.USE]?: boolean;
};
[PermissionTypes.FILE_SEARCH]?: {
[Permissions.USE]?: boolean;
};