XperienceCommunity.MemberRoles.Admin
2.0.2
See the version list below for details.
dotnet add package XperienceCommunity.MemberRoles.Admin --version 2.0.2
NuGet\Install-Package XperienceCommunity.MemberRoles.Admin -Version 2.0.2
<PackageReference Include="XperienceCommunity.MemberRoles.Admin" Version="2.0.2" />
paket add XperienceCommunity.MemberRoles.Admin --version 2.0.2
#r "nuget: XperienceCommunity.MemberRoles.Admin, 2.0.2"
// Install XperienceCommunity.MemberRoles.Admin as a Cake Addin #addin nuget:?package=XperienceCommunity.MemberRoles.Admin&version=2.0.2 // Install XperienceCommunity.MemberRoles.Admin as a Cake Tool #tool nuget:?package=XperienceCommunity.MemberRoles.Admin&version=2.0.2
XperienceCommunity.MemberRoles
Description
This is a community created package to allow Member Roles and permissions in Xperience by Kentico (until this logic is baked into the product).
Roles can be created, assigned to Members, and Content Items can be secured with Authentication and Member Role Permissions applied to themselves or inherited from a parent Content Folders and Web Page Items.
Library Version Matrix
This project is using Xperience Version v30.0.0.
Xperience Version | Library Version |
---|---|
>= 30.0.* | 2.0.0 |
29.7.* | 1.0.0 |
Package Installation
Add the package to your application using the .NET CLI
dotnet add package XperienceCommunity.MemberRoles.Admin
Additionally, you can elect to install only the required packages on specific projects if you have separation of concerns:
XperienceCommunity.MemberRoles.Core : No Xperience Dependencies XperienceCommunity.MemberRoles: Kentico.Xperience.WebApp Dependent (No Admin) XperienceCommunity.MemberRoles.Admin : Kentico.Xperience.Admin (Admin Items)
Quick Start
In your startup, when you call the .AddIdentity<TUser,TRole>
...
- Use
TagApplicationUserRole
as theTRole
(still use Kentico'sApplicationuser
asTUser
) - Call the extension
.AddMemberRolesStores<TUser, TRole>()
off yourIdentityBuilder
This will hook up all the interfaces (including IUserRoleStore
, and IRoleStore
) and run the installation logic on application run. Below is the basic Kentico Authentication Hookup with Member Roles.
public static void AddStandardKenticoAuthentication(WebApplicationBuilder builder)
{
// Adds Basic Kentico Authentication, needed for user context and some tools
builder.Services.AddAuthentication();
// XperienceCommunity.MemberRoles, make sure Role is TagApplicationUserRole or an inherited member here
builder.Services.AddIdentity<ApplicationUser, TagApplicationUserRole>(options => {
// Ensures that disabled member accounts cannot sign in
options.SignIn.RequireConfirmedAccount = true;
// Ensures unique emails for registered accounts
options.User.RequireUniqueEmail = true;
})
.AddUserStore<ApplicationUserStore<ApplicationUser>>()
.AddMemberRolesStores<ApplicationUser, TagApplicationUserRole>() // XperienceCommunity.MemberRoles
.AddUserManager<UserManager<ApplicationUser>>()
.AddSignInManager<SignInManager<ApplicationUser>>();
// Adds authorization support to the app
builder.Services.AddAuthorization();
}
Guide
Please see the Admin Guide for Xperience Users or the Developer Guide for instructions.
Using Web Page Route Security
While this package includes the ability to create and assign Roles to Users, to define Content Item Permissions, and Interfaces that can be used to determine access and filter out items, it does not have the systems to automatically apply Web Page Security rules for a page request.
I will be working on the updated version of the XperienceCommunity.Authorization package (probably wil be renamed XperienceCommunity.DevTools.Authorization
) shortly that will then leverage these to introduce Controller Based and Tree Routing Based request filtering, tying into Page Permissions.
Screenshots
Existing "Is Secure" on Content Items
Kentico released the "Is Secure" on Content Items (Properties → Membership (Web Channel) or just Properties (Content Hub)) which was intended to mark items as needing Member Authentication to accesses. I was not able to leverage this field, so for all intents and purposes, this field is ignored by Member Roles in it's filtering. The new UIs have their own "Is Secure" field which you should use.
Contributing
Please feel free to create a pull request if you find any bugs. If you are on the Xperience Community Slack, that's the best place to hit me up so I get eyes on it.
License
Distributed under the MIT License. See LICENSE.md
for more
information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Kentico.Xperience.Admin (>= 30.0.0)
- XperienceCommunity.MemberRoles (>= 2.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on XperienceCommunity.MemberRoles.Admin:
Package | Downloads |
---|---|
XperienceCommunity.Baseline.Core.Admin.Xperience
The Baseline a set of Core Systems, Tools, and Structure to ensure a superior Kentico Website that's easy to migrate, for Kentico Xperience 13 and eventually Xperience by Kentico |
|
XperienceCommunity.DevTools.Authorization.MemberRoles.Admin
Allows you to place authorization rules on Controller Actions and PageBuilder requests that can authorize based on Users (Members), Roles, Authenticated, or custom logic. This version leverages the XperienceCommunity.MemberRoles system for Role and Page Permission Assignment. Admin package only contains the dependency for the Member Roles Admin (for easier installation) |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.3.2 | 292 | 12/21/2024 |
2.3.1 | 136 | 12/19/2024 |
2.3.0 | 80 | 12/19/2024 |
2.2.0 | 74 | 12/19/2024 |
2.1.0 | 78 | 12/19/2024 |
2.0.2 | 90 | 12/18/2024 |
2.0.1 | 87 | 12/12/2024 |
2.0.0 | 82 | 12/12/2024 |
1.0.5 | 78 | 12/11/2024 |
1.0.4 | 76 | 12/10/2024 |
1.0.3 | 79 | 12/9/2024 |
1.0.2 | 82 | 12/6/2024 |
1.0.1 | 90 | 12/2/2024 |
1.0.0 | 96 | 11/28/2024 |
Made the installer service not required (just won't install if it's not added via the service collection extension)