Skip to content

Authchecks in the UI are static to site scope, needs to handle organization scope for multi-org #14003

Closed
@Emyrk

Description

@Emyrk

[permissionsToCheck] (https://github.com/coder/coder/blob/main/site/src/contexts/auth/permissions.tsx#L17) is used to toggle UI elements based on user capabilities (authz checks). These checks are all site wide scoped. In a multi-org setting checks.createTemplates can be false at a site wide, but be true for some subset of organizations.

UI elements like "Create Template" need to show even if the site wide permission fails.

Ideally we could pass some any for the organization_id? So like this maybe? Unsure how this could actually be implemented 🤔

  [checks.createTemplates]: {
    object: {
      resource_type: "template",
      organization_id: "any", // Can do in at least 1 organization??
    },
    action: "update",
  },

Metadata

Metadata

Assignees

Labels

need-backendIssues that need backend work

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions