Class UserGroupAssignmentAuthorization
Shared authorization logic for user group assignment.
Inheritance
object
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Core.dll
Syntax
public static class UserGroupAssignmentAuthorization
Methods
View SourceGetUnauthorizedGroupAssignments(IEnumerable<string>, IEnumerable<string>, IEnumerable<string>)
Returns the group aliases that the performing user is not authorized to assign.
Declaration
public static IReadOnlyList<string> GetUnauthorizedGroupAssignments(IEnumerable<string> performingUserGroupAliases, IEnumerable<string> requestedGroupAliases, IEnumerable<string> existingGroupAliases)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | performingUserGroupAliases | The group aliases the performing user belongs to. |
| IEnumerable<string> | requestedGroupAliases | The group aliases being assigned to the target user. |
| IEnumerable<string> | existingGroupAliases | The group aliases the target user currently belongs to. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<string> | Group aliases that are being added but the performing user does not belong to. An empty collection means the assignment is authorized. |
Remarks
Non-admin users can remove any groups but can only add groups they themselves belong to. Callers should check for admin status before calling this method, as admins bypass this check.