vertx-auth icon indicating copy to clipboard operation
vertx-auth copied to clipboard

#521 Support a collections of roles in the MongoDB AuthorizationProvider

Open bfreuden opened this issue 4 years ago • 2 comments

Motivation:

This is a first proposal. I have modified the MongoAuthorizationTest to create and initialize a roles collection with a superadmin role having a sudo permission. I have added a new testAuthoriseWithRolePermission method to MongoAuthorizationTest showing that the "read roles" behavior is disabled by default: tim does not have the sudo permission event if he has the superadmin role.

The new MongoAuthorizationWithRolesTest test extends MongoAuthorizationTest, enables the "read roles" behavior, overrides the testAuthoriseWithRolePermission and modifies it expectations: tim now has the sudo permission.

bfreuden avatar Dec 04 '21 13:12 bfreuden

I forgot to say that I modified some javadoc comments, hoping that they will be clearer. I can revert to the original comments if you don't like the new ones.

bfreuden avatar Dec 04 '21 23:12 bfreuden

Wait... the PR is containing a line that should not be here:

user.authorizations().clear(providerId);

That is linked with the issue described here: https://groups.google.com/g/vertx/c/vTCLEQsv1N0

I will remove it for the moment.

bfreuden avatar Dec 15 '21 20:12 bfreuden

This PR isn't applicable to this repo anymore. It should go on #vert-x3/vertx-auth

pmlopes avatar Mar 23 '23 14:03 pmlopes