Skip to content

Backend: duplicate role #580

Closed as not planned
Closed as not planned

Description

@rodmgwgu

Add an API operation that creates a new custom role from an existing one (standard or custom), copying display fields and the full permission set, with a server-derived name (the Duplicate UI is fire-and-forget, no form). Copies the source's resource type (cannot change it). Only the definition is copied, not member assignments — the duplicate starts with zero members. Specified by the Custom Roles API ADR (#469); persisted via #561's model. Superuser-only.

Acceptance

  • Duplicate creates a new user_defined role with the source's permissions and resource type.
  • Name derivation + collision handling defined (e.g. " copy"/"V2").
  • No assignments copied.
  • Audit recorded; tests for duplicating a standard role and a custom role.

Activity

  1. added
    willow
    on Oct 30, 2026
  2. rodmgwgu commented on Nov 5, 2026

    @rodmgwgu
    ContributorAuthor

    Under discussion: the draft Custom Roles API ADR for #469 (ADR 0036, not merged yet) proposes changes that affect this ticket. Nothing is final until the ADR is approved.

    Proposed change: no backend duplicate operation. Duplicate opens the create wizard with "Clone from role" and the source role preselected. The client prefills the resource type and permissions from the catalog, and the administrator enters a name and can change the permissions. It then sends a normal create request (#589).

    Why:

    • The wizard lets the administrator change the copied permissions, so the client already sends the full definition.
    • A server-generated name such as "Course Staff (copy)" would also set the role ID, which never changes (ADR 0035). Copied roles would keep IDs that don't describe them after a rename.

    If this is approved, this ticket can be closed, or reduced to a test that copying through create works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    willow

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions