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.

identity.rbac.role.delete

Delete an existing role.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @platform.identity-rbac
  • Tags: identity, rbac, role, delete
  • File: packages/libs/identity-rbac/src/contracts/rbac.ts
  • field.key.label
    identity.rbac.role.delete
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    identity.rbac.role.delete
    field.description.label

    Delete an existing role.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @platform.identity-rbac
  • Tags: identity, rbac, role, delete
  • File: packages/libs/identity-rbac/src/contracts/rbac.ts
  • field.tags.label
    identity,rbac,role,delete
    field.owners.label
    @platform.identity-rbac
    field.stability.label
    stable

    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'],
    	},
    });