PromucFlow_constructor/app/server/scripts/node
dependabot[bot] 41a51c2885
Bump bl from 2.2.0 to 2.2.1 in /app/server/scripts/node (#496)
Bumps [bl](https://github.com/rvagg/bl) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v2.2.0...v2.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:52:35 +05:30
..
.editorconfig Add a node.js script to dump examples organization (#448) 2020-09-02 17:15:55 +05:30
acl-migration.js Add a node.js script to dump examples organization (#448) 2020-09-02 17:15:55 +05:30
dump-examples-org.js Add a node.js script to dump examples organization (#448) 2020-09-02 17:15:55 +05:30
package-lock.json Bump bl from 2.2.0 to 2.2.1 in /app/server/scripts/node (#496) 2020-09-07 12:52:35 +05:30
package.json Add a node.js script to dump examples organization (#448) 2020-09-02 17:15:55 +05:30
README.md Add a node.js script to dump examples organization (#448) 2020-09-02 17:15:55 +05:30

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.