Search Results for

    Show / Hide Table of Contents
    View Source

    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 Source

    GetUnauthorizedGroupAssignments(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.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX