Skip to content

Commit

Permalink
[backend] Remove allowed_organizations from User
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact authored and richard-julien committed Jan 16, 2025
1 parent bed52b9 commit 112c4f5
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 15 deletions.
2 changes: 0 additions & 2 deletions opencti-platform/opencti-graphql/src/domain/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,6 @@ const buildSessionUser = (origin, impersonate, provider, settings) => {
default_hidden_types: user.default_hidden_types,
group_ids: user.groups?.map((g) => g.internal_id) ?? [],
organizations: user.organizations ?? [],
allowed_organizations: user.allowed_organizations,
administrated_organizations: user.administrated_organizations ?? [],
inside_platform_organization: user.inside_platform_organization,
allowed_marking: user.allowed_marking.map((m) => ({
Expand Down Expand Up @@ -1386,7 +1385,6 @@ export const buildCompleteUser = async (context, client) => {
default_hidden_types,
groups,
organizations,
allowed_organizations,
administrated_organizations,
individual_id: individualId,
inside_platform_organization: isUserPlatform,
Expand Down
1 change: 0 additions & 1 deletion opencti-platform/opencti-graphql/src/types/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ interface AuthUser extends BasicStoreIdentifier {
roles: Array<UserRole>
groups: Array<Group>
organizations: Array<BasicStoreCommon>
allowed_organizations: Array<BasicStoreCommon>
administrated_organizations: Array<BasicStoreCommon>
capabilities: Array<UserCapability>
allowed_marking: Array<StoreMarkingDefinition>
Expand Down
8 changes: 0 additions & 8 deletions opencti-platform/opencti-graphql/src/utils/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const SYSTEM_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
default_marking: [],
max_shareable_marking: [],
Expand Down Expand Up @@ -125,7 +124,6 @@ export const RETENTION_MANAGER_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand Down Expand Up @@ -159,7 +157,6 @@ export const RULE_MANAGER_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand Down Expand Up @@ -193,7 +190,6 @@ export const AUTOMATION_MANAGER_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand Down Expand Up @@ -227,7 +223,6 @@ export const DECAY_MANAGER_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand Down Expand Up @@ -261,7 +256,6 @@ export const GARBAGE_COLLECTION_MANAGER_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand Down Expand Up @@ -296,7 +290,6 @@ export const REDACTED_USER: AuthUser = {
groups: [],
capabilities: [],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand All @@ -323,7 +316,6 @@ export const TELEMETRY_MANAGER_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
organizations: [],
allowed_organizations: [],
allowed_marking: [],
max_shareable_marking: [],
default_marking: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ describe('File storage file listing', () => {
user_email: 'user-no-capa@opencti.io',
inside_platform_organization: true,
allowed_marking: [],
allowed_organizations: [],
roles: [{ internal_id: '08f558bc-b93d-40dc-8e86-f70309d9e1a6', id: '08f558bc-b93d-40dc-8e86-f70309d9e1a6', name: 'No capa' }],
groups: [],
capabilities: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ describe('Notification manager behaviors test', async () => {
groups: [],
capabilities: [{ name: 'KNOWLEDGE_KNUPDATE' }],
organizations: [],
allowed_organizations: [{ internal_id: userOrganizationId, standard_id: userOrganizationStandardId }],
allowed_marking: [{ internal_id: greenMarkingInternalId, standard_id: greenMarkingStandardId }],
default_marking: [],
all_marking: [],
Expand Down
2 changes: 0 additions & 2 deletions opencti-platform/opencti-graphql/tests/utils/testQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ export const ADMIN_USER: AuthUser = {
groups: [],
capabilities: [{ name: BYPASS }],
all_marking: [],
allowed_organizations: [],
inside_platform_organization: true,
allowed_marking: [],
default_marking: [],
Expand Down Expand Up @@ -695,7 +694,6 @@ export const buildStandardUser = (
groups: [],
capabilities: capabilities ?? [{ name: 'KNOWLEDGE_KNUPDATE_KNDELETE' }],
all_marking: (allMarkings ?? []) as StoreMarkingDefinition[],
allowed_organizations: [],
inside_platform_organization: true,
allowed_marking: allowedMarkings as StoreMarkingDefinition[],
default_marking: [],
Expand Down

0 comments on commit 112c4f5

Please sign in to comment.