Skip to content

Commit

Permalink
[backend] add Publish exploration capability (#4903)
Browse files Browse the repository at this point in the history
  • Loading branch information
marieflorescontact committed Jan 10, 2024
1 parent 2aa18de commit 513383c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum Capabilities {
EXPLORE
EXPLORE_EXUPDATE
EXPLORE_EXUPDATE_EXDELETE
EXPLORE_EXUPDATE_PUBLISH
MODULES
MODULES_MODMANAGE
SETTINGS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum Capabilities {
EXPLORE
EXPLORE_EXUPDATE
EXPLORE_EXUPDATE_EXDELETE
EXPLORE_EXUPDATE_PUBLISH
MODULES
MODULES_MODMANAGE
SETTINGS
Expand Down
1 change: 1 addition & 0 deletions opencti-platform/opencti-graphql/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,7 @@ export enum Capabilities {
Explore = 'EXPLORE',
ExploreExupdate = 'EXPLORE_EXUPDATE',
ExploreExupdateExdelete = 'EXPLORE_EXUPDATE_EXDELETE',
ExploreExupdatePublish = 'EXPLORE_EXUPDATE_PUBLISH',
Knowledge = 'KNOWLEDGE',
KnowledgeKnaskimport = 'KNOWLEDGE_KNASKIMPORT',
KnowledgeKnenrichment = 'KNOWLEDGE_KNENRICHMENT',
Expand Down
5 changes: 4 additions & 1 deletion opencti-platform/opencti-graphql/src/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ export const CAPABILITIES = [
name: 'EXUPDATE',
description: 'Create / Update exploration',
attribute_order: 1100,
dependencies: [{ name: 'EXDELETE', description: 'Delete exploration', attribute_order: 1200 }],
dependencies: [
{ name: 'EXDELETE', description: 'Delete exploration', attribute_order: 1200 },
{ name: 'PUBLISH', description: 'Publish exploration', attribute_order: 1300 },
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { executionContext, SYSTEM_USER } from '../utils/access';
import { addCapability } from '../domain/grant';

export const up = async (next) => {
const context = executionContext('migration');
await addCapability(context, SYSTEM_USER, {
name: 'EXPLORE_EXUPDATE_PUBLISH',
description: 'Publish exploration',
attribute_order: 1300
});
next();
};

export const down = async (next) => {
next();
};

0 comments on commit 513383c

Please sign in to comment.