Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create two different role decorator #227

Closed
carolanegt opened this issue Aug 31, 2023 · 0 comments
Closed

Create two different role decorator #227

carolanegt opened this issue Aug 31, 2023 · 0 comments
Assignees

Comments

@carolanegt
Copy link

**Create two different role decorator **
It would be useful to have two different role decorator.
In the file opentera/teraserver/python/opentera/services/ServiceAccessManager.py , a decorator is present to verify if a user as the appropriate role to access a ressource. For now, the user need to have all the role precised in the decorator to have access to the ressource (line 427). In my case, it would be really usefull to have the key word any. In fact, I want to have the ability to access a function according to the specific role of the person and assigned a single role per user. However, with the current function, it's complicated because if I want to give two people with different roles access to a function and subsequently give access to separate functions for each role, it's impossible. I have to give the two roles to the two individuals to have access to the first function, and therefore, the 2 users can have access to the function which would be reserved for only one of the roles.

Describe alternatives you've considered
Changing in library the word all for any and use this modified decorator instead.

UserRoleAlternative.txt

@doumdi doumdi self-assigned this Sep 7, 2023
doumdi added a commit that referenced this issue Sep 13, 2023
doumdi added a commit that referenced this issue Sep 13, 2023
doumdi added a commit that referenced this issue Sep 13, 2023
@SBriere SBriere closed this as completed Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants