-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Role permission settings are overwritten if a tenant is started #13035
Comments
I'm working on it, also on the issue about dynamic permissions in the AdminController. Here do you meant in the Also, if it's another permission, try to re-edit the role before a new startup to see what was persisted, this to make the distinction between the RoleUpdater and the AdminController. |
Yes, that is correct. I meant the I don't see the error anymore on my end too. But the I'm confused... |
Okay thanks, I will take care of this, anyway I may change the RoleUpdater approach and will ask you to test it again when it will be ready ;) |
Thank you. But I still want to know why its behaving differently than yesterday ;-) |
Okay, it happens again if I use an older DB snapshot from a date before adding the commit with this change. So the problem may be somehow related to a migration and it is fixed when the permissions are saved once again. It would be less critical in this case. |
Okay thanks for the info |
Beside this being breaking for existing installations I think the only (minor) issue that remains after more research is a false log entry in foreach (var permissionName in additionalPermissionNames)
{
if (_logger.IsEnabled(LogLevel.Debug))
{
_logger.LogDebug("Default role '{Role}' granted permission '{Permission}'", group.RoleName, permissionName);
}
if (rolesDocument.PermissionGroups[group.RoleName].Contains(permissionName, StringComparer.OrdinalIgnoreCase))
{
// The permission was previously assigned to the role, we can't assign it again.
continue;
}
await _roleManager.AddClaimAsync(role, new Claim(Permission.ClaimType, permissionName));
} The line should only be logged if the claim is actually being added. |
Yes I saw, was already fixed locally, anyway I will check different things, I think this week end, for example if we can prevent the logic to be executed on each shell activation, if possible. |
Describe the bug
Whenever a tenant is activated, the
RoleUpdater
reapplies any default permissions to the roles. This overwrites any adjustments made from the admin dashboard. This breaks all permissions assigned to specific content types, because e.g. the anonymous role is always reset.To Reproduce
Example steps to reproduce the behavior:
Expected behavior
Permission settings on roles are persisted between site restarts.
This bug was introduced by PR #12510.
See also bug #13024.
The text was updated successfully, but these errors were encountered: