-
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
Do not obsolete the SiteOwner
claim
#17092
Comments
We discussed why that claim was unnecessary here: #17087. Hope it'll make things clearer 😃 |
Thanks, but I'm still not convinced. As we have removed all permission claims for administrators and we do not have a fixed administrator role name, by removing the site owner claim one cannot determine which role has specific permission from the claims alone. E.g. if you use Orchard in headless mode, there is no way to get that information. |
The roles - including the administrator role - have always been and will always be stored as claims in both cookie and token principals, so you can simply do
No we don't. And given that it's no longer added/present/used in the 2.1.2 patch that shipped earlier today, it's extremely unlikely it will reappear in a future version. It serves no purpose. |
It bears the information which role is the actual site owner role, as the name can be any. Of cause one can use the |
No. It was a flag with a single value supported ( if (await _userManager.IsInRoleAsync(user, await _systemRoleNameProvider.GetAdminRoleAsync()))
{
claims.AddClaim(StandardClaims.SiteOwner);
} public static class StandardClaims
{
/// <summary>
/// This claim is assigned by the system during the login process if the user belongs to the Administrator role.
/// </summary>
public static readonly Claim SiteOwner = new("SiteOwner", "true");
} |
Yes, that was badly expressed by me and not what I mean. I was trying to explain that having a claim of role |
If you have the administrator role claim, you're an administrator and you have the site owner permissions. It's as simple as that and that's exactly the information that "site owner" claim was conveying. In any case, you shouldn't try to check for the claim yourself: you should instead use the authorization service to determine whether you're allowed to perform a specific action: if you're an administrator, it will do the role check for you and bypass all the permission checks. |
I understand what you mean and I don't disagree in general. But the site owner claim was a specific replacement for removing all permission claims for users which previously had the site owner permission. Having all the permissions as claims may be questionable, but now without the site owner claim we have no distinction anymore, if a user has a specific permission or not when the administrator role name is not known. |
Anyway, I've voiced my concerns, but I'm not going to fight it until the end ;-) |
Originally posted by @gvkries in #17089 (comment)
The text was updated successfully, but these errors were encountered: