PromucFlow_constructor/app/server/scripts/node/README.md

50 lines
1.4 KiB
Markdown
Raw Normal View History

2020-06-12 11:54:21 +00:00
# ACL Migration Steps
1. Create a super user (with email <superuser_acl@appsmith.com>), using the sign-up API.
2022-07-20 11:54:16 +00:00
2. Add `manage` and `read` permissions for `workspaces`, `applications`, `pages` and `actions` for this super user,
on ALL existing documents (in corresponding collections). Once this is done, the policies field of workspaces,
2020-06-12 11:54:21 +00:00
for example, should look something like:
```json
{
"policies": [
{
2022-07-20 11:54:16 +00:00
"permission" : "manage:workspaces",
2020-06-12 11:54:21 +00:00
"users" : [
"superuser_acl@appsmith.com"
],
"groups" : []
},
{
2022-07-20 11:54:16 +00:00
"permission" : "read:workspaces",
2020-06-12 11:54:21 +00:00
"users" : [
"superuser_acl@appsmith.com"
],
"groups" : []
}
]
}
```
3. Disable emails for invite API actions.
2022-07-20 11:54:16 +00:00
4. For each user, for each workspace in the user's `workspaceIds` list, hit the invite user API for that
workspace, using session of the super user.
2020-06-12 11:54:21 +00:00
2022-07-20 11:54:16 +00:00
5. Remove super user from the workspace policies, without disturbing other permission values.
2020-06-12 11:54:21 +00:00
6. Remove super user from users collection.
# Running
Assuming you have node (>=v12), use the following command to run the migration:
```sh
npm install
node acl-migration.js 'https://localhost/api/v1/' 'mongodb://localhost:27017/mobtools'
2020-06-12 11:54:21 +00:00
```
The first argument should be a running API endpoint, and the second argument should be a URI to the database that this
API endpoint is running on.