import type { RbacPolicyGroup } from './RbacPolicyGroup'; import type { RbacUser } from './RbacUser'; /** * Serializer for usergroup-specific RBAC policies using ModelSerializer pattern. * Accepts usergroup_id and role, generates resources and role internally. */ export type UserGroupPolicy = { readonly id: number; /** * Policy name. If not supplied, defaults to a UUID4 */ readonly name: string; /** * Platform key where the usergroup belongs */ platform_key: string; /** * ID of the usergroup to manage access for */ usergroup_id: number; /** * Role for accessing this usergroup (read, edit, view analytics, send notifications) */ role: string; /** * List of resources this policy applies to */ readonly resources: any; readonly users: Array; readonly groups: Array; /** * List of RbacGroup IDs to grant access to this usergroup */ groups_to_add?: Array; /** * List of RbacGroup IDs to revoke access from this usergroup */ groups_to_remove?: Array; /** * List of user IDs to grant access to this usergroup */ users_to_add?: Array; /** * List of user IDs to revoke access from this usergroup */ users_to_remove?: Array; };