PromucFlow_constructor/app/server/scripts/node
Bharat Patodi 743d6cb00d
chore: Replace equality and inequality operators with their strict versions (#7585)
Co-authored-by: Arpit Mohan <arpit@appsmith.com>
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2022-02-03 09:42:38 +05:30
..
.editorconfig
acl-migration.js chore: Fixing yoda conditions in the code (#8297) 2021-10-08 22:21:24 +05:30
dump-examples-org.js chore: Replace equality and inequality operators with their strict versions (#7585) 2022-02-03 09:42:38 +05:30
package-lock.json chore: bump follow-redirects from 1.14.3 to 1.14.7 in /app/server/scripts/node (#10413) 2022-01-15 03:43:12 +05:30
package.json chore(deps-dev): bump axios in /app/server/scripts/node (#7318) 2021-09-09 22:14:58 +05:30
README.md

ACL Migration Steps

  1. Create a super user (with email superuser_acl@appsmith.com), using the sign-up API.

  2. Add manage and read permissions for organizations, applications, pages and actions for this super user, on ALL existing documents (in corresponding collections). Once this is done, the policies field of organizations, for example, should look something like:

{
    "policies": [         
        {
            "permission" : "manage:organizations",
            "users" : [ 
                "superuser_acl@appsmith.com"
            ],
            "groups" : []
        }, 
        {
            "permission" : "read:organizations",
            "users" : [ 
                "superuser_acl@appsmith.com"
            ],
            "groups" : []
        }
    ]
}
  1. Disable emails for invite API actions.

  2. For each user, for each organization in the user's organizationIds list, hit the invite user API for that organization, using session of the super user.

  3. Remove super user from the organization policies, without disturbing other permission values.

  4. Remove super user from users collection.

Running

Assuming you have node (>=v12), use the following command to run the migration:

npm install
node acl-migration.js 'https://localhost/api/v1/' 'mongodb://localhost:27017/mobtools'

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.