OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Delete an existing role.
Goal
Allow admins to remove unused roles.
Context
Role management. Removes all policy bindings using this role.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { ScalarTypeEnum, SchemaModel } from '@lssm-tech/lib.schema';
import { SuccessResultModel } from './user';
export const DeleteRoleContract = defineCommand({
meta: {
key: 'identity.rbac.role.delete',
version: '1.0.0',
stability: 'stable',
owners: ['@platform.identity-rbac'],
tags: ['identity', 'rbac', 'role', 'delete'],
description: 'Delete an existing role.',
goal: 'Allow admins to remove unused roles.',
context: 'Role management. Removes all policy bindings using this role.',
},
io: {
input: DeleteRoleInputModel,
output: SuccessResultModel,
errors: {
ROLE_IN_USE: {
description: 'Role is still assigned to users or organizations',
http: 409,
gqlCode: 'ROLE_IN_USE',
when: 'Role has active bindings',
},
},
},
policy: {
auth: 'admin',
},
sideEffects: {
audit: ['role.deleted'],
},
});