-
Notifications
You must be signed in to change notification settings - Fork 946
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] migration: rename exploration capabilities
- Loading branch information
1 parent
f16b760
commit 8f0ffb3
Showing
3 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
...cti-platform/opencti-graphql/src/migrations/1704893567321-capability-publish-knowledge.js
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...pencti-graphql/src/migrations/1708079784540-investigations-and-dashboards-capabilities.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { executionContext, SYSTEM_USER } from '../utils/access'; | ||
import { addCapability } from '../domain/grant'; | ||
import { elLoadById, elReplace } from '../database/engine'; | ||
|
||
export const up = async (next) => { | ||
const context = executionContext('migration'); | ||
// ------ Add Manage Public Dashboards capability | ||
await addCapability(context, SYSTEM_USER, { | ||
name: 'EXPLORE_EXUPDATE_PUBLISH', | ||
description: 'Manage Public Dashboards', | ||
attribute_order: 1300 | ||
}); | ||
// ------ Access exploration renaming | ||
const accessCapability = await elLoadById(context, SYSTEM_USER, 'capability--c2f6d8be-29c7-5e7f-ab17-dfa14a349025'); | ||
const accessCapabilityPatch = { description: 'Access Dashboards and investigations' }; | ||
await elReplace(accessCapability._index, accessCapability.internal_id, { doc: accessCapabilityPatch }); | ||
// ------ Create / Update exploration renaming | ||
const updateCapability = await elLoadById(context, SYSTEM_USER, 'capability--722e8727-5e8a-5b5e-8c1e-3b71b8415170'); | ||
const updateCapabilityPatch = { description: 'Create / Update Dashboards and investigations' }; | ||
await elReplace(updateCapability._index, updateCapability.internal_id, { doc: updateCapabilityPatch }); | ||
// ------ Delete exploration renaming | ||
const deleteCapability = await elLoadById(context, SYSTEM_USER, 'capability--287d57a8-5e9a-573f-8f22-ea321f5cbc90'); | ||
const deleteCapabilityPatch = { description: 'Delete Dashboards and investigations' }; | ||
await elReplace(deleteCapability._index, deleteCapability.internal_id, { doc: deleteCapabilityPatch }); | ||
next(); | ||
}; | ||
|
||
export const down = async (next) => { | ||
next(); | ||
}; |