View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18738Bug reportsUser / Groups / Rolespublic2023-08-08 11:48
ReporterMazi Assigned Toollehar  
PrioritynormalSeverityblock 
Status acknowledgedResolutionopen 
Product Version5.6.x 
Summary18738: Admins allowed to create new admin users are not allowed to assign user roles
Description

Our customer has 3-4 user roles defined at their system and there are 2-3 people allowed to add additional admin users. But when these create nee users, they do not even see the user roles set up at the system.

Steps To Reproduce

Steps to reproduce

  1. Create a user role.
  2. Create a new admin user with permissions to create new users.
  3. Log in as the new user and create another user.
  4. Once the user was created, try assigning them a user role -> not possible since available user roles are not shown.

Expected result

See available user roles in order to assign them to new user.

Actual result

No user roles are shown.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)5.6.14
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL 5
Server OS (if known)
Webserver software & version (if known)
PHP Version8.1.6

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2023-04-11 11:03

updater   ~74452

@DenisChenu, what do you think about this blocker? I think it makes sense that if you are allowed to create new users, you should also be able to assign a user role. Of course, that should exclude roles with superadmin rights.

DenisChenu

DenisChenu

2023-04-11 11:08

developer   ~74453

You should also be able to assign a user role

ONLY if you have all rights in this role …

User can not give more right then they already have

Mazi

Mazi

2023-04-11 11:38

updater   ~74455

I agree, user rights at the role need to be checked against the user's permissions.

Mazi

Mazi

2023-04-19 09:00

updater   ~74537

@gabrieljenik, what do you think about this issue?

gabrieljenik

gabrieljenik

2023-04-19 14:34

manager   ~74541

ONLY if you have all rights in this role …
User can not give more right then they already have

If I understand correctly, I don't agree.
What you say is that the person that assigns the roles should have at least the same access level fo the role being assigned, right?

That doens't lead to a proper separation of concerns.
If I want someone just to create users and some other person to assign them permissions, how should it with the above schema?

I am not sure this collides with other user permissions stories which are on hold.

Mazi

Mazi

2023-04-19 14:39

updater   ~74542

Let me explain the issue in a different way. Currently only superadmins can make use of the role feature at all. So if there are other admins responsible for creating user accounts, they can not use this helpful feature at all.
If we adjust this and allow other admins to use roles, we need to check role details first before granting them access to certain roles. Otherwise, there could be a role with all user permissions and the admin allowed to create users could create an account with all rights for himself to extend the access that was initially granted to him.

gabrieljenik

gabrieljenik

2023-04-19 15:49

manager   ~74543

Last edited: 2023-04-19 15:50

I am not very aware of roles.

Still, one question that pops up...
If we adjust this and allow other admins to use roles, one thing could be to use roles. The other one to configure them.
Make sense?

there could be a role with all user permissions

Maybe the "role creation / management" sahll not be set by roles, but by permission?
That way, someone may use roles but not update them.

DenisChenu

DenisChenu

2023-04-19 15:54

developer   ~74544

Last edited: 2023-04-19 15:55

User can not give more right then they already have

If I understand correctly, I don't agree.
What you say is that the person that assigns the roles should have at least the same access level fo the role being assigned, right?

The reason here was If you allow an user to create user but disallow to update all surveys : there are a reason.

If you don' check if current user have all roles permission what can happen:

  1. The user create NEWUSER (with an email of him)
  2. User give roles "ALLSURVEYMANGEMENT" to NEWUSER
  3. User log in as NEWUSER and can update all surveys.

I really understand finally why roles can be set only by superadmins …

Mazi

Mazi

2023-04-20 14:12

updater   ~74561

Correct, @DenisChenu - On the one hand it makes sense that only superadmins can use roles. On the other hand the feature is not available to common users with create user rights.

DenisChenu

DenisChenu

2023-04-20 14:52

developer   ~74562

Yes …

But i don't know the precise specifications for roles feature ;)

Maybe a list of roles allowed by user ?

gabrieljenik

gabrieljenik

2023-04-20 18:22

manager   ~74563

Please remind me ...
Right now, someone that has user creation permissions can create a user with permissions to access almost everything right?
If so, then, the possibility of someone creating a non-desired very powerfull user already exists.

For me, the roles and users should be able to be handled separately.
That means, there should be the possibility of having separation of concerns: Someone that create users shall not be able to create roles.

To achieve that we could add:
1 - A specific permission to handle roles. Right now, there is not. (or I missed it)
2 - A specific permission (or other way) to NOT have users to assign individual global permissions
One way is through a "permissions" permission

Thoughts?

DenisChenu

DenisChenu

2023-04-20 18:46

developer   ~74564

Last edited: 2023-04-20 18:50

Right now, someone that has user creation permissions can create a user with permissions to access almost everything right?

No : he can not give permission if he don't have permission
See [edit bad link] https://github.com/LimeSurvey/LimeSurvey/blob/b1d4dbd53114ac6b082f88a0ce023a15aa38cab4/application/models/Permission.php#L285

If so, then, the possibility of someone creating a non-desired very powerfull user already exists.

No, it was fixed a long time ago, and refixed in 4.0.beta if i remind.

then my Thought : we must really avoid user to give more rights they already have !

[Edit ]
For Survey and SurveyGroups (and other models in future)

  1. Checkbox is disable if current user didn't have permission : https://github.com/LimeSurvey/LimeSurvey/blob/b1d4dbd53114ac6b082f88a0ce023a15aa38cab4/application/models/services/PermissionManager.php#L77
  2. User can not update Permission if he don't have it : https://github.com/LimeSurvey/LimeSurvey/blob/b1d4dbd53114ac6b082f88a0ce023a15aa38cab4/application/models/services/PermissionManager.php#L138 (can NOT remove permission too).
gabrieljenik

gabrieljenik

2023-04-20 19:26

manager   ~74566

Last edited: 2023-04-20 19:28

we must really avoid user to give more rights they already have !

According to he can not give permission if he don't have permission, then it is already done.

But thinking on roles, if there is a role for a powerfull user, then someone could use it and create a user with it.
Maybe we could have some roles only to be assigned by users with a different permission?
It would be like having a "reserved" flag on roles, which would make them available to specific users.

Another alternative?
Having a 2nd authorization and a time delay when assigning specific roles.

But this should be a common topic.
How is this handled on other systems?

From the top of my head, the issue is usually handled not by limiting user creation or permission assignment, but by logging what each user does and who created the user.

gabrieljenik

gabrieljenik

2023-04-20 19:28

manager   ~74567

Another idea (not sure if bright):
Permission over user creation, permission management and roles can only be given by super admin?

DenisChenu

DenisChenu

2023-04-20 19:34

developer   ~74568

According to he can not give permission if he don't have permission, then it is already done.

Yes, currently. But allow user to set roles is an update here.

Maybe we could have some roles only to be assigned by users with a different permission?

A new settings on roles «Can be set by user without superadmin rights» and a BIG warning. It think it's OK :+1:

Maybe we could have some roles only to be assigned by users with a different permission?

I don't understand here ?

Permission over user creation, permission management and roles can only be given by super admin?

Currently we have

  • User with User creation permission
  • Can give permission they have to created user (if they can update)
  • Roles are limited to superamin (read) user.
Mazi

Mazi

2023-04-21 13:20

updater   ~74570

I like this idea:
A new settings on roles «Can be set by user without superadmin rights» and a BIG warning

ollehar

ollehar

2023-08-08 11:24

administrator   ~76482

Should this be moved to feature request?

Mazi

Mazi

2023-08-08 11:48

updater   ~76484

I tend to say it is a bug (Currently only superadmins can make use of the role feature at all.) because otherwise a fix will never be implemented ;-)

Issue History

Date Modified Username Field Change
2023-04-11 10:55 Mazi New Issue
2023-04-11 11:03 Mazi Note Added: 74452
2023-04-11 11:03 Mazi Bug heat 0 => 2
2023-04-11 11:08 DenisChenu Note Added: 74453
2023-04-11 11:08 DenisChenu Bug heat 2 => 4
2023-04-11 11:38 Mazi Note Added: 74455
2023-04-11 13:14 ollehar Priority none => normal
2023-04-19 09:00 Mazi Note Added: 74537
2023-04-19 14:34 gabrieljenik Note Added: 74541
2023-04-19 14:34 gabrieljenik Bug heat 4 => 6
2023-04-19 14:39 Mazi Note Added: 74542
2023-04-19 15:49 gabrieljenik Note Added: 74543
2023-04-19 15:50 gabrieljenik Note Edited: 74543
2023-04-19 15:54 DenisChenu Note Added: 74544
2023-04-19 15:54 DenisChenu Note Edited: 74544
2023-04-19 15:55 DenisChenu Note Edited: 74544
2023-04-19 15:55 DenisChenu Note Edited: 74544
2023-04-20 14:12 Mazi Note Added: 74561
2023-04-20 14:52 DenisChenu Note Added: 74562
2023-04-20 18:22 gabrieljenik Note Added: 74563
2023-04-20 18:46 DenisChenu Note Added: 74564
2023-04-20 18:46 DenisChenu Note Edited: 74564
2023-04-20 18:50 DenisChenu Note Edited: 74564
2023-04-20 19:26 gabrieljenik Note Added: 74566
2023-04-20 19:28 gabrieljenik Note Edited: 74566
2023-04-20 19:28 gabrieljenik Note Added: 74567
2023-04-20 19:34 DenisChenu Note Added: 74568
2023-04-21 13:20 Mazi Note Added: 74570
2023-08-08 11:24 ollehar Note Added: 76482
2023-08-08 11:24 ollehar Bug heat 6 => 8
2023-08-08 11:24 ollehar Assigned To => ollehar
2023-08-08 11:24 ollehar Status new => acknowledged
2023-08-08 11:48 Mazi Note Added: 76484