From 8e1dd0ae9942aacb944c9277b9277329da58933e Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Wed, 29 Jul 2020 20:42:13 +0200 Subject: [PATCH] Entitites for security RESTful API --- .../src/main/typescript/entities/security.ts | 95 +++++++++++++++++++ .../src/main/typescript/entities/workflow.ts | 10 ++ 2 files changed, 105 insertions(+) create mode 100644 ccm-core-apiclient/src/main/typescript/entities/security.ts create mode 100644 ccm-core-apiclient/src/main/typescript/entities/workflow.ts diff --git a/ccm-core-apiclient/src/main/typescript/entities/security.ts b/ccm-core-apiclient/src/main/typescript/entities/security.ts new file mode 100644 index 000000000..c3a087cf1 --- /dev/null +++ b/ccm-core-apiclient/src/main/typescript/entities/security.ts @@ -0,0 +1,95 @@ +import { + assertProperties, + LocalizedString, +} from "@libreccm/ccm-apiclient-commons"; +import { CcmObjectId } from "./core"; +import { TaskId } from "./workflow"; + +export interface EmailAddressData { + address: string; + bouncing: boolean; + verified: boolean; +} + +export interface GroupData { + partyId: number; + uuid: string; + name: string; + memberships: GroupUserMembership[]; + roleMemberships: PartyRoleMembership[]; +} + +export interface GroupUserMembership { + membershipId: number; + uuid: string; + user: PartyId; +} + +export interface PartyId { + partyId: number; + uuid: string; + name: string; +} + +export interface PartyRoleMembership { + membershipId: number; + uuid: string; + role: RoleId; +} + +export interface RoleAssignedTask { + taskAssignmentId: number; + uuid: string; + task: TaskId; +} + +export interface RoleData { + roleId: number; + uuid: string; + name: string; + description: LocalizedString; + permissions: RolePermission[]; +} + +export interface RoleId { + roleId: number; + uuid: string; + name: string; +} + +export interface RolePartyMember { + membershipId: number; + uuid: string; + party: PartyId; +} + +export interface RolePermission { + permissionId: number; + uuid: string; + grantedPrivilege: string; + object: CcmObjectId; + creationUser: PartyId; + creationDate: Date; + creationIp: string; + inheritedFrom: CcmObjectId; +} + +export interface UserData { + partyId: number; + uuid: string; + name: string; + givenName: string; + familyName: string; + primaryEmailAddress: EmailAddressData; + emailAddresses: EmailAddressData[]; + banned: boolean; + passwordResetRequired: boolean; + groupMemberships: UserGroupMembership[]; + roleMemberships: PartyRoleMembership[]; +} + +export interface UserGroupMembership { + membershipId: number; + uuid: string; + group: PartyId; +} diff --git a/ccm-core-apiclient/src/main/typescript/entities/workflow.ts b/ccm-core-apiclient/src/main/typescript/entities/workflow.ts new file mode 100644 index 000000000..9e88c74f3 --- /dev/null +++ b/ccm-core-apiclient/src/main/typescript/entities/workflow.ts @@ -0,0 +1,10 @@ +import { + LocalizedString, + assertProperties, +} from "@libreccm/ccm-apiclient-commons"; + +export interface TaskId { + taskId: number; + uuid: string; + label: LocalizedString; +} \ No newline at end of file