8000 Handling invalid permissions when creating/updating custom roles · Issue #16632 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content
Handling invalid permissions when creating/updating custom roles #16632
@Emyrk

Description

@Emyrk

When posting a custom role, invalid permissions are omitted by the backend:

SitePermissions: db2sdk.List(filterInvalidPermissions(req.SitePermissions), sdkPermissionToDB),
OrgPermissions: db2sdk.List(filterInvalidPermissions(req.OrganizationPermissions), sdkPermissionToDB),
UserPermissions: db2sdk.List(filterInvalidPermissions(req.UserPermissions), sdkPermissionToDB),

This was done to prevent an unsolvable error. If an invalid permission was to exist (via some migration or other means). The custom role could never be updated via the UI, as the permissions do not exist to "uncheck".

The solution was to ignore invalid permissions. This has the downside of silently removing things, which could be intuitive.

Invalid permissions should have some UX, maybe a warning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIdesign neededRequest for more beauty

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0