import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { PaginationRequest, PaginationResponse } from "../../filter/v2/filter.js"; import { Administrator, AdministratorFieldName, AdministratorSearchFilter } from "./query.js"; export declare const protobufPackage = "zitadel.internal_permission.v2"; export interface ListAdministratorsRequest { /** Paginate through the results using a limit, offset and sorting. */ pagination?: PaginationRequest | undefined; /** * The field the result is sorted by. The default is the creation date. * Beware that if you change this, your result pagination might be inconsistent. */ sortingColumn: AdministratorFieldName; /** Filter the administrator roles to be returned. */ filters: AdministratorSearchFilter[]; } export interface ListAdministratorsResponse { /** Pagination contains the current sequence and the total result count. */ pagination: PaginationResponse | undefined; /** Administrators contains the list of administrators matching the request. */ administrators: Administrator[]; } export interface CreateAdministratorRequest { /** UserID is the ID of the user who should be granted the administrator role. */ userId: string; /** Resource is the type of the resource the administrator roles should be granted for. */ resource: ResourceType | undefined; /** * Roles are the roles that should be granted to the user for the specified resource. * Note that roles are currently specific to the resource type. * This means that if you want to grant a user the administrator role for an organization and a project, * you need to create two administrator roles. */ roles: string[]; } export interface ResourceType { /** Instance is the resource type for granting administrator privileges on the instance level. */ instance?: boolean | undefined; /** OrganizationID is required to grant administrator privileges for a specific organization. */ organizationId?: string | undefined; /** ProjectID is required to grant administrator privileges for a specific project. */ projectId?: string | undefined; /** ProjectGrantID is required to grant administrator privileges for a specific project grant. */ projectGrant?: ResourceType_ProjectGrant | undefined; } export interface ResourceType_ProjectGrant { /** ProjectID is the unique identifier of the project the project grant belongs to. */ projectId: string; /** * OrganizationID is the unique identifier of the organization the project was granted to * and on which the administrator role should be granted. */ organizationId: string; } export interface CreateAdministratorResponse { /** CreationDate is the timestamp when the administrator role was created. */ creationDate: Date | undefined; } export interface UpdateAdministratorRequest { /** UserID is the ID of the user whose administrator roles should be updated. */ userId: string; /** Resource is the type of the resource the administrator roles should be granted for. */ resource: ResourceType | undefined; /** * Roles are the roles that the user should be granted. * Note that any role previously granted to the user and not present in the list will be revoked. */ roles: string[]; } export interface UpdateAdministratorResponse { /** ChangeDate is the timestamp when the administrator role was last updated. */ changeDate: Date | undefined; } export interface DeleteAdministratorRequest { /** UserID is the ID of the user whose administrator roles should be removed. */ userId: string; /** Resource is the type of the resource the administrator roles should be removed for. */ resource: ResourceType | undefined; } export interface DeleteAdministratorResponse { /** * DeletionDate is the timestamp when the administrator role was deleted. * Note that the deletion date is only guaranteed to be set if the deletion was successful during the request. * In case the deletion occurred in a previous request, the deletion date might not be set. */ deletionDate: Date | undefined; } export declare const ListAdministratorsRequest: MessageFns; export declare const ListAdministratorsResponse: MessageFns; export declare const CreateAdministratorRequest: MessageFns; export declare const ResourceType: MessageFns; export declare const ResourceType_ProjectGrant: MessageFns; export declare const CreateAdministratorResponse: MessageFns; export declare const UpdateAdministratorRequest: MessageFns; export declare const UpdateAdministratorResponse: MessageFns; export declare const DeleteAdministratorRequest: MessageFns; export declare const DeleteAdministratorResponse: MessageFns; /** * InternalPermissionService provides methods to manage permissions for resource * and their management in ZITADEL itself also known as "administrators". * * If you want to manage permissions and roles within your project or application, * please use the AuthorizationsService. */ export type InternalPermissionServiceDefinition = typeof InternalPermissionServiceDefinition; export declare const InternalPermissionServiceDefinition: { readonly name: "InternalPermissionService"; readonly fullName: "zitadel.internal_permission.v2.InternalPermissionService"; readonly methods: { /** * List Administrators * * ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. * * Required permissions depend on the resource type: * - "iam.member.read" for instance administrators * - "org.member.read" for organization administrators * - "project.member.read" for project administrators * - "project.grant.member.read" for project grant administrators * - no permissions required for listing own administrator roles */ readonly listAdministrators: { readonly name: "ListAdministrators"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; /** * Create Administrator * * CreateAdministrator grants an administrator role to a user for a specific resource. * * Note that the roles are specific to the resource type. * This means that if you want to grant a user the administrator role for an organization and a project, * you need to create two administrator roles. * * Required permissions depend on the resource type: * - "iam.member.write" for instance administrators * - "org.member.write" for organization administrators * - "project.member.write" for project administrators * - "project.grant.member.write" for project grant administrators */ readonly createAdministrator: { readonly name: "CreateAdministrator"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; /** * Update Administrator * * UpdateAdministrator updates the specific administrator role. * * Note that any role previously granted to the user and not present in the request will be revoked. * * Required permissions depend on the resource type: * - "iam.member.write" for instance administrators * - "org.member.write" for organization administrators * - "project.member.write" for project administrators * - "project.grant.member.write" for project grant administrators */ readonly updateAdministrator: { readonly name: "UpdateAdministrator"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; /** * Delete Administrator * * DeleteAdministrator revokes an administrator role from a user. * * In case the administrator role is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the administrator role was deleted during the request. * * Required permissions depend on the resource type: * - "iam.member.delete" for instance administrators * - "org.member.delete" for organization administrators * - "project.member.delete" for project administrators * - "project.grant.member.delete" for project grant administrators */ readonly deleteAdministrator: { readonly name: "DeleteAdministrator"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; }; }; export interface InternalPermissionServiceImplementation { /** * List Administrators * * ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. * * Required permissions depend on the resource type: * - "iam.member.read" for instance administrators * - "org.member.read" for organization administrators * - "project.member.read" for project administrators * - "project.grant.member.read" for project grant administrators * - no permissions required for listing own administrator roles */ listAdministrators(request: ListAdministratorsRequest, context: CallContext & CallContextExt): Promise>; /** * Create Administrator * * CreateAdministrator grants an administrator role to a user for a specific resource. * * Note that the roles are specific to the resource type. * This means that if you want to grant a user the administrator role for an organization and a project, * you need to create two administrator roles. * * Required permissions depend on the resource type: * - "iam.member.write" for instance administrators * - "org.member.write" for organization administrators * - "project.member.write" for project administrators * - "project.grant.member.write" for project grant administrators */ createAdministrator(request: CreateAdministratorRequest, context: CallContext & CallContextExt): Promise>; /** * Update Administrator * * UpdateAdministrator updates the specific administrator role. * * Note that any role previously granted to the user and not present in the request will be revoked. * * Required permissions depend on the resource type: * - "iam.member.write" for instance administrators * - "org.member.write" for organization administrators * - "project.member.write" for project administrators * - "project.grant.member.write" for project grant administrators */ updateAdministrator(request: UpdateAdministratorRequest, context: CallContext & CallContextExt): Promise>; /** * Delete Administrator * * DeleteAdministrator revokes an administrator role from a user. * * In case the administrator role is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the administrator role was deleted during the request. * * Required permissions depend on the resource type: * - "iam.member.delete" for instance administrators * - "org.member.delete" for organization administrators * - "project.member.delete" for project administrators * - "project.grant.member.delete" for project grant administrators */ deleteAdministrator(request: DeleteAdministratorRequest, context: CallContext & CallContextExt): Promise>; } export interface InternalPermissionServiceClient { /** * List Administrators * * ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. * * Required permissions depend on the resource type: * - "iam.member.read" for instance administrators * - "org.member.read" for organization administrators * - "project.member.read" for project administrators * - "project.grant.member.read" for project grant administrators * - no permissions required for listing own administrator roles */ listAdministrators(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Create Administrator * * CreateAdministrator grants an administrator role to a user for a specific resource. * * Note that the roles are specific to the resource type. * This means that if you want to grant a user the administrator role for an organization and a project, * you need to create two administrator roles. * * Required permissions depend on the resource type: * - "iam.member.write" for instance administrators * - "org.member.write" for organization administrators * - "project.member.write" for project administrators * - "project.grant.member.write" for project grant administrators */ createAdministrator(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Update Administrator * * UpdateAdministrator updates the specific administrator role. * * Note that any role previously granted to the user and not present in the request will be revoked. * * Required permissions depend on the resource type: * - "iam.member.write" for instance administrators * - "org.member.write" for organization administrators * - "project.member.write" for project administrators * - "project.grant.member.write" for project grant administrators */ updateAdministrator(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Delete Administrator * * DeleteAdministrator revokes an administrator role from a user. * * In case the administrator role is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the administrator role was deleted during the request. * * Required permissions depend on the resource type: * - "iam.member.delete" for instance administrators * - "org.member.delete" for organization administrators * - "project.member.delete" for project administrators * - "project.grant.member.delete" for project grant administrators */ deleteAdministrator(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } export {};