You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
BobRay
added
the
bug
The issue in the code or project, which should be addressed.
label
Dec 27, 2024
BobRay
changed the title
MODX 3.1.0 setup crashes is modUserGroupRole authority levels are not unique
MODX 3.1.0 setup crashes if modUserGroupRole authority levels are not unique
Dec 27, 2024
The authority of a modUserGroupRole MUST be unique because that is the only reference back to a modUserGroupRole from any ACL record. This SHOULD have always been true, but seems to have been an oversight. There is no reason I can think of to have multiple modUserGroupRoles with the same authority. A "member" with authority of 9999 can be reused on every modUserGroup if you do not need different authority levels within a single group. This was a conscious decision, and the easiest way to resolve a problem in managing ACLs when authority values that were not unique were used to create the ACLs.
Fair enough. It did catch me by surprise on several sites. Still, the message needs to be corrected, possibly earlier in the process, showing the correct object name. And, I'd suggest giving a little more information about how to fix things so the use can complete the upgrade.
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.The text was updated successfully, but these errors were encountered: