Description
Bug report
Summary
I modUserGroupRole authority levels are not unique, setup crashes with this message:
"Multiple modUserGroup records with the same authority were found"
Step to reproduce
Create modUserGroup records with the same authority value
Run setup.
I assume this is the result of this change:
"Make authority a unique index on modUserGroupRole (#16587)"
First of all, I think the message is incorrect since it refers to modUserGroup records rather than modUserGroupRole records. The modUserGroup table has no authority
field.
More important, I can't think of any reason for requiring unique authority levels.
I often use the same authority level for multiple user group roles. When users need different permissions, I put them in different user groups rather then giving them different authority levels. IMO, doing so makes it much easier to diagnose permission problems. I can't think of any harm that would be caused by having duplicate authority levels.
It also seems unreasonable to make current users edit their existing authority values in order to upgrade MODX, or to force them to make sure their authority levels are all unique. When you try to create a new role that uses an existing authority level, you get this message: role_err_save
, and there's nothing in the description of the authority field that says the value has to be unique.