-
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
Deprecate SiteOwner
permission and retain Administrator as system role
#16781
Conversation
…rdCore into ma/update-roles
See #16763 (comment). |
I don't think we should add a special flag like Concerning the |
@gvkries the HasFullAccess property was replaced with |
I am still seeing it in recipes. Maybe reflect it there too, or at least rename with |
...chardCore/OrchardCore.Infrastructure.Abstractions/Security/Services/RoleServiceExtensions.cs
Outdated
Show resolved
Hide resolved
@sebastienros yes this way missed. Should be fixed now. |
...Core.Tests/Modules/OrchardCore.Media/SecureMedia/ViewMediaFolderAuthorizationHandlerTests.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Views/Admin/Edit.cshtml
Outdated
Show resolved
Hide resolved
Co-authored-by: Zoltán Lehóczky <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I've only some minor notes/improvements if you don't mind.
Thanks @MikeAlhayek
src/OrchardCore.Modules/OrchardCore.Roles/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Security/RoleClaim.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Migrations/RolesMigrations.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Roles/Services/RoleUpdater.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Security/StandardPermissions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Roles.Core/Services/DefaultSystemRoleNameProvider.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Georg von Kries <[email protected]>
Co-authored-by: Georg von Kries <[email protected]>
@sebastienros do you like to add anything else here or you good with it? |
continue; | ||
} | ||
|
||
var hasSiteOwner = r.RoleClaims.Any(x => x.ClaimValue == "SiteOwner"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make it work for new sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already does as during create roles
will have no records so this logic will not be called. But for safety, I added a check against claims.
var roles = roleManager.Roles.ToList(); | ||
|
||
var adminRoles = new List<Role>(); | ||
var adminSystemRoleName = OrchardCoreConstants.Roles.Administrator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read settings["AdminRoleName]
so users can define what they want to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now be configured from the settings using OrchardCore_Roles:AdminRoleName
Fix #11920
Fix #16763
Site Owner Permission Deprecated, Administrator Role Retained as System Role
The
SiteOwner
permission has been deprecated and will be removed in future releases. To avoid breaking changes, a fast-track migration has been added that automatically assigns theAdministrator
role to any user with theSiteOwner
permission.The Recipes feature now authorizes against the new
ManageRecipes
permission, instead of relying on the deprecatedSiteOwner
.If the existing
Administrator
did not have theSiteOwner
permission, a new role will be generated and assigned as the system admin role. This role may be namedAdmin
,SiteAdmin
,SiteAdministration
,SiteOwner
, orAdmin{N}
, where{N}
depending on availability to ensures a unique role name. Additionally, any user previously assigned theSiteOwner
permission will automatically be granted this newly created role.Recipes Feature
New 'Manage Recipes' Permission Added
Previously, only users with the
SiteOwner
permission could run recipes. Now, a newManageRecipes
permission allows you to grant recipe management capabilities to any role, providing greater flexibility in permission assignment.Themes Feature
Users with 'Apply Theme' Permission Can List Themes
Previously, only users with the
SiteOwner
permission could list themes. Now, users with the existingApplyTheme
permission can also list and apply themes, enhancing theme management capabilities.