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

Security: ability to assign multiple roles to a user #222

Closed
1 of 2 tasks
nnixaa opened this issue Feb 13, 2018 · 6 comments · Fixed by #549
Closed
1 of 2 tasks

Security: ability to assign multiple roles to a user #222

nnixaa opened this issue Feb 13, 2018 · 6 comments · Fixed by #549

Comments

@nnixaa
Copy link
Collaborator

nnixaa commented Feb 13, 2018

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request
@stefanwuthrich
Copy link

up vote

@ruisebastiao
Copy link

+1

@nnixaa nnixaa added this to the rc.10 milestone Jun 10, 2018
@nnixaa
Copy link
Collaborator Author

nnixaa commented Jun 10, 2018

Hey @stefanwuthrich, @ruisebastiao could you please share your use cases so that we can better design this feature? I presume this would be like this:

  • user can have one or more roles (like user & editor)
  • permissions will be merged allowing the user to do what both user and editor roles are allowed to do

@ruisebastiao
Copy link

Hello @nnixaa , in my case i have the following user schema (mongodb):

{
    "_id": ObjectId("5a96dafee06e0b349bbfc482"),
    "password": "",
    "email": "",
    "username": "Rui Sebastiao",
    "role": "admin",
    "units": [
        {
            "useUnitTimeZone": false,
            "chartTimezone": "",
            "_id": ObjectId("59d4c6932f695e7f8df66d2e"),
            "unitrole": "enduser",
            "unit_description": "Unit 1",
            "serialnumber": "000000001"
        },
        {
            "useUnitTimeZone": false,
            "chartTimezone": "",
            "_id": ObjectId("59d4c6932f695e7f8df66d2e"),
            "unitrole": "admin",
            "unit_description": "Unit 2",
            "serialnumber": "000000002"
        }
   ]
}

I have a global 'role' (root,admin,enduser) and i have a 'unitrole' in each unit of my array of units, some of this units could be added by other users and have a 'enduser' role for example). So there are some items on my page that are linked to my global role and other items that depends of the 'unitrole' of the selected unit.

@stefanwuthrich
Copy link

Hi @nnixaa
for my case it's enough to getRoles() as array

@ruisebastiao
Copy link

ruisebastiao commented Jul 6, 2018

great 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants