node_acl icon indicating copy to clipboard operation
node_acl copied to clipboard

remove user

Open Trenrod opened this issue 6 years ago • 3 comments

Hi, cannot find a function to remove a user. E.g. when a user unregisters I want to complete clean up everything from him also the db entries with _bucketname users.

Or do I have to delete it manually? Thank you.

Trenrod avatar Oct 29 '18 12:10 Trenrod

I have same issue to remove the user from acl_users and acl-meta tables.

shawnzxx avatar Nov 17 '18 07:11 shawnzxx

+1

RuneSP avatar Nov 21 '18 14:11 RuneSP

Tried to clean it up by myself. But stuck in a performance issue deleting resources

        const ressources = await aclhelper.acl.whatResources(accountRoleKey);
        if (ressources != null && Object.keys(ressources).length > 0) {
          for (let idx = 0; idx < Object.keys(ressources).length; idx++) {
            await aclhelper.acl.removeAllow(accountRoleKey, Object.keys(ressources)[idx], "*");
            // Takes >40sec having 3k roles
            await aclhelper.acl.removeResource(Object.keys(ressources)[idx]);
          }
        }

https://github.com/OptimalBits/node_acl/issues/189

Trenrod avatar Nov 22 '18 13:11 Trenrod