OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#41299] Updated API spec for placeholder users
Eric Schubertff52a7fada95
diff --git a/config/locales/en.yml b/config/locales/en.ymlindex bfca26aeffa..a397818825e 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -2025,6 +2025,7 @@ en:label_member_new: "New member"label_member_all_admin: "(All roles due to admin status)"label_member_plural: "Members"+ label_membership_plural: "Memberships"lable_membership_added: "Member added"lable_membership_updated: "Member updated"label_menu_badge:diff --git a/docs/api/apiv3/components/examples/group-response.yml b/docs/api/apiv3/components/examples/group-response.ymlnew file mode 100644index 00000000000..46277c8082f--- /dev/null+++ b/docs/api/apiv3/components/examples/group-response.yml@@ -0,0 +1,42 @@+# Example: GroupResponse+---+value:+ _type: Group+ id: 26+ name: Force Users+ createdAt: '2024-01-11T15:54:16.542Z'+ updatedAt: '2024-01-11T15:58:02.237Z'+ _embedded:+ members:+ - _hint: Principal resource shortened for brevity+ _type: User+ id: 23+ name: Grogu Jarin+ - _hint: Principal resource shortened for brevity+ _type: User+ id: 14+ name: Mara Jade+ - _hint: Principal resource shortened for brevity+ _type: User+ id: 3+ name: Darth Vader+ _links:+ self:+ href: '/api/v3/groups/26'+ title: Force Users+ memberships:+ href: '/api/v3/memberships?filters=%5B%7B%22principal%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%2226%22%5D%7D%7D%5D'+ title: Memberships+ delete:+ href: '/api/v3/groups/26'+ method: delete+ updateImmediately:+ href: '/api/v3/groups/26'+ method: patch+ members:+ - href: '/api/v3/users/23'+ title: Grogu Jarin+ - href: '/api/v3/users/14'+ title: Mara Jade+ - href: '/api/v3/users/3'+ title: Darth Vaderdiff --git a/docs/api/apiv3/components/examples/placeholder-user-response.yml b/docs/api/apiv3/components/examples/placeholder-user-response.ymlnew file mode 100644index 00000000000..33052d030f2--- /dev/null+++ b/docs/api/apiv3/components/examples/placeholder-user-response.yml@@ -0,0 +1,26 @@+# Example: PlaceholderUserResponse+---+value:+ _type: PlaceholderUser+ id: 27+ name: Akolyth+ createdAt: '2024-02-12T11:52:24.708Z'+ updatedAt: '2024-02-12T11:52:24.708Z'+ _links:+ self:+ href: '/api/v3/placeholder_users/27'+ title: Akolyth+ memberships:+ href: '/api/v3/memberships?filters=%5B%7B%22principal%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%2227%22%5D%7D%7D%5D'+ title: Memberships+ updateImmediately:+ href: '/api/v3/placeholder_users/27'+ title: Update Akolyth+ method: patch+ delete:+ href: '/api/v3/placeholder_users/27'+ title: Delete Akolyth+ method: delete+ showUser:+ href: '/placeholder_users/27'+ type: text/htmldiff --git a/docs/api/apiv3/components/examples/user-response.yml b/docs/api/apiv3/components/examples/user-response.ymlnew file mode 100644index 00000000000..729d29afba4--- /dev/null+++ b/docs/api/apiv3/components/examples/user-response.yml@@ -0,0 +1,39 @@+# Example: UserResponse+---+value:+ _type: User+ id: 14+ name: Mara Jade+ createdAt: '2022-04-04T08:07:22.910Z'+ updatedAt: '2024-02-09T09:01:17.382Z'+ login: member+ admin: false+ firstName: Mara+ lastName: Jade+ email: [email protected]+ avatar: 'https://secure.gravatar.com/avatar/17dd23570f3bd129d06db9b48b7a41b8?default=404&secure=true'+ status: active+ identityUrl: null+ language: en+ _links:+ self:+ href: '/api/v3/users/14'+ title: Mara Jade+ memberships:+ href: '/api/v3/memberships?filters=%5B%7B%22principal%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%2214%22%5D%7D%7D%5D'+ title: Memberships+ showUser:+ href: '/users/14'+ type: text/html+ updateImmediately:+ href: '/api/v3/users/14'+ title: Update member+ method: patch+ lock:+ href: '/api/v3/users/14/lock'+ title: Set lock on member+ method: post+ delete:+ href: '/api/v3/users/14'+ title: Delete member+ method: deletediff --git a/docs/api/apiv3/components/schemas/group_collection_model.yml b/docs/api/apiv3/components/schemas/group_collection_model.ymlindex 358bed75605..7a9b17d4a13 100644--- a/docs/api/apiv3/components/schemas/group_collection_model.yml+++ b/docs/api/apiv3/components/schemas/group_collection_model.yml@@ -14,11 +14,11 @@ allOf:properties:self:allOf:- - $ref: "./link.yml"+ - $ref: './link.yml'- description: |-This group collection- **Resource**: GroupCollectionReadModel+ **Resource**: Collection_embedded:type: objectrequired:diff --git a/docs/api/apiv3/components/schemas/group_model.yml b/docs/api/apiv3/components/schemas/group_model.ymlindex bb2753286c9..00c68d09675 100644--- a/docs/api/apiv3/components/schemas/group_model.yml+++ b/docs/api/apiv3/components/schemas/group_model.yml@@ -1,107 +1,52 @@# Schema: GroupModel----type: object-required:- - _type- - id- - _links-properties:- id:- type: integer- description: The group id- minimum: 1- name:- type: string- description: |-- Group's full name, formatting depends on instance settings-- # Conditions- - admin- createdAt:- type: string- format: date-time- description: |-- Time of creation-- # Conditions- - admin- updatedAt:- type: string- format: date-time- description: Time of the most recent change to the user- _links:- type: object+allOf:+ - $ref: './principal_model.yml'+ - type: objectrequired:- - self+ - _embeddedproperties:- self:- allOf:- - $ref: './link.yml'- - description: |-- This group resource-- **Resource**: Group- delete:- allOf:- - $ref: './link.yml'- - description: |-- Deletes the group.-- # Conditions- **Permission**: Administrator- updateImmediately:- allOf:- - $ref: './link.yml'- - description: |-- Updates the group's attributes.-- # Conditions- **Permission**: Administrator- memberships:- allOf:- - $ref: './link.yml'- - description: |-- Link to collection of all the group's memberships. The list will only include the memberships in projects- in which the requesting user has the necessary permissions.-- **Resource**: MemberCollection-- # Conditions- **Permission**: `view members` or `manage members` in any project- members:- type: array- items:- allOf:- - $ref: './link.yml'- - description: |-- One of the members of the group.-- **Resource**: User-- # Conditions- **Permission**: `manage members` in any project to read & admin to write--example:- _type: Group- id: 9- name: Stormtroopers- createdAt: '2022-09-23T11:06:36.024Z'- updatedAt: '2022-09-23T11:06:36.024Z'- _links:- self:- href: '/api/v3/groups/9'- title: Stormtroopers- delete:- href: '/api/v3/group/9'- method: delete- memberships:- href: '/api/v3/memberships?filters=[{"principal":{"operator":"=","values":["9"]}}]'- title: Memberships- updateImmediately:- href: '/api/v3/group/9'- method: patch- members:- - href: '/api/v3/users/363'- title: ST-097E- - href: '/api/v3/users/60'- title: ST-C-334+ _embedded:+ type: object+ properties:+ members:+ type: array+ description: Embedded list of members.+ items:+ - $ref: './user_model.yml'+ _links:+ type: object+ properties:+ members:+ type: array+ items:+ allOf:+ - $ref: './link.yml'+ - description: |-+ A member of the group++ # Conditions:++ - user has permission `manage_members` in any project++ **Resource**: User+ delete:+ allOf:+ - $ref: './link.yml'+ - description: |-+ An href to delete the group.++ # Conditions:++ - `admin`+ updateImmediately:+ allOf:+ - $ref: './link.yml'+ - description: |-+ An href to update the group.++ # Conditions:++ - `admin`++ **Resource**: Groupdiff --git a/docs/api/apiv3/components/schemas/placeholder_user_collection_model.yml b/docs/api/apiv3/components/schemas/placeholder_user_collection_model.ymlnew file mode 100644index 00000000000..36a2bf17768--- /dev/null+++ b/docs/api/apiv3/components/schemas/placeholder_user_collection_model.yml@@ -0,0 +1,46 @@+# Schema: PlaceholderUserCollectionModel+---+allOf:+ - $ref: './collection_model.yml'+ - type: object+ required:+ - _links+ - _embedded+ properties:+ _links:+ type: object+ required:+ - self+ properties:+ self:+ allOf:+ - $ref: "./link.yml"+ - description: |-+ This placeholder user collection++ **Resource**: Collection+ _embedded:+ type: object+ required:+ - elements+ properties:+ elements:+ type: array+ items:+ $ref: './placeholder_user_model.yml'++example:+ _type: Collection+ total: 2+ count: 2+ _links:+ self:+ href: '/api/v3/placeholder_users'+ _embedded:+ elements:+ - _hint: PlaceholderUser resource shortened for brevity+ _type: PlaceholderUser+ id: 1337+ - _hint: PlaceholderUser resource shortened for brevity+ _type: PlaceholderUser+ id: 1338diff --git a/docs/api/apiv3/components/schemas/placeholder_user_create_model.yml b/docs/api/apiv3/components/schemas/placeholder_user_create_model.ymlnew file mode 100644index 00000000000..be2fd48855a--- /dev/null+++ b/docs/api/apiv3/components/schemas/placeholder_user_create_model.yml@@ -0,0 +1,7 @@+# Schema: PlaceholderUserCreateModel+---+type: object+properties:+ name:+ type: string+ description: The new name of the placeholder user to be created.diff --git a/docs/api/apiv3/components/schemas/placeholder_user_model.yml b/docs/api/apiv3/components/schemas/placeholder_user_model.ymlnew file mode 100644index 00000000000..563758b9542--- /dev/null+++ b/docs/api/apiv3/components/schemas/placeholder_user_model.yml@@ -0,0 +1,36 @@+# Schema: PlaceholderUserModel+---+allOf:+ - $ref: './principal_model.yml'+ - type: object+ properties:+ _links:+ type: object+ required:+ - showUser+ properties:+ showUser:+ allOf:+ - $ref: './link.yml'+ - description: |-+ A relative path to show the placeholder user in the web application.+ delete:+ allOf:+ - $ref: './link.yml'+ - description: |-+ An href to delete the placeholder user.++ # Conditions:++ - `manage_placeholder_user`+ updateImmediately:+ allOf:+ - $ref: './link.yml'+ - description: |-+ An href to update the placeholder user.++ # Conditions:++ - `manage_placeholder_user`++ **Resource**: PlaceholderUserdiff --git a/docs/api/apiv3/components/schemas/principal_collection_model.yml b/docs/api/apiv3/components/schemas/principal_collection_model.ymlnew file mode 100644index 00000000000..7ca06dde312--- /dev/null+++ b/docs/api/apiv3/components/schemas/principal_collection_model.yml@@ -0,0 +1,53 @@+# Schema: PrincipalCollectionModel+---+allOf:+ - $ref: './collection_model.yml'+ - type: object+ required:+ - _links+ - _embedded+ properties:+ _links:+ type: object+ required:+ - self+ - representations+ properties:+ self:+ allOf:+ - $ref: "./link.yml"+ - description: |-+ This principal collection++ **Resource**: Collection+ _embedded:+ type: object+ required:+ - elements+ properties:+ elements:+ type: array+ items:+ anyOf:+ - $ref: './user_model.yml'+ - $ref: './placeholder_user_model.yml'+ - $ref: './group_model.yml'++example:+ _type: Collection+ total: 3+ count: 3+ _links:+ self:+ href: '/api/v3/principals'+ _embedded:+ elements:+ - _hint: User resource shortened for brevity+ _type: User+ id: 1337+ - _hint: Group resource shortened for brevity+ _type: Group+ id: 1338+ - _hint: PlaceholderUser resource shortened for brevity+ _type: PlaceholderUser+ id: 1339diff --git a/docs/api/apiv3/components/schemas/principal_model.yml b/docs/api/apiv3/components/schemas/principal_model.ymlnew file mode 100644index 00000000000..10f31f6e821--- /dev/null+++ b/docs/api/apiv3/components/schemas/principal_model.yml@@ -0,0 +1,53 @@+# Schema: PrincipalModel+---+type: object+required:+ - _type+ - id+ - name+ - _links+properties:+ _type:+ type: string+ enum:+ - User+ - Group+ - PlaceholderUser+ id:+ type: integer+ description: The principal's unique identifier.+ minimum: 1+ name:+ type: string+ description: The principal's display name, layout depends on instance settings.+ createdAt:+ type: string+ format: date-time+ description: Time of creation+ updatedAt:+ type: string+ format: date-time+ description: Time of the most recent change to the principal+ _links:+ type: object+ required:+ - self+ properties:+ self:+ allOf:+ - $ref: './link.yml'+ - description: |-+ This principal resource.++ **Resource**: User|Group|PlaceholderUser+ memberships:+ allOf:+ - $ref: './link.yml'+ - description: |-+ An href to the collection of the principal's memberships.++ # Conditions:++ - user has permission `view_members` or `manage_members` in any project++ **Resource**: Collectiondiff --git a/docs/api/apiv3/components/schemas/principals_model.yml b/docs/api/apiv3/components/schemas/principals_model.ymldeleted file mode 100644index f18694db82f..00000000000--- a/docs/api/apiv3/components/schemas/principals_model.yml+++ /dev/null@@ -1,94 +0,0 @@-# Schema: PrincipalsModel-----type: object-example:- _type: Collection- total: 4- count: 4- _embedded:- elements:- - _type: User- id: 4- login: Eliza92778- admin: false- firstName: Danika- lastName: O'Keefe- name: Danika O'Keefe- email: [email protected]- avatar: https://example.org/users/4/avatar- createdAt: '2015-03-20T12:57:02.646Z'- updatedAt: '2015-06-16T15:28:14.550Z'- status: active- identityUrl:- _links:- self:- href: "/api/v3/users/4"- title: Danika O'Keefe- showUser:- href: "/users/4"- type: text/html- updateImmediately:- href: "/api/v3/users/4"- title: Update Eliza92778- method: patch- lock:- href: "/api/v3/users/4/lock"- title: Set lock on Eliza92778- method: post- delete:- href: "/api/v3/users/4"- title: Delete Eliza92778- method: delete- - _type: User- id: 2- login: Sebastian9686- admin: false- firstName: Peggie- lastName: Feeney- name: Peggie Feeney- email:- avatar: https://example.org/users/4/avatar- createdAt: '2015-03-20T12:56:55.963Z'- updatedAt: '2015-03-20T12:56:55.963Z'- status: active- identityUrl:- _links:- self:- href: "/api/v3/users/2"- title: Peggie Feeney- showUser:- href: "/users/2"- type: text/html- updateImmediately:- href: "/api/v3/users/2"- title: Update Sebastian9686- method: patch- lock:- href: "/api/v3/users/2/lock"- title: Set lock on Sebastian9686- method: post- delete:- href: "/api/v3/users/2"- title: Delete Sebastian9686- method: delete- - _type: Group- id: 9- name: The group- createdAt: '2015-09-23T11:06:36.687Z'- updatedAt: '2015-09-23T11:06:36.687Z'- _links:- self:- href: "/api/v3/groups/9"- title: The group- - _type: PlaceholderUser- id: 29- name: UX Designer- createdAt: '2018-09-23T11:06:36.687Z'- updatedAt: '2019-10-23T11:06:36.687Z'- _links:- self:- href: "/api/v3/placeholder_users/29"- title: UX Designer- _links:- self:- href: "/api/v3/principals"diff --git a/docs/api/apiv3/components/schemas/project_collection_model.yml b/docs/api/apiv3/components/schemas/project_collection_model.ymlindex 298bfa54718..ec34cb9e5b4 100644--- a/docs/api/apiv3/components/schemas/project_collection_model.yml+++ b/docs/api/apiv3/components/schemas/project_collection_model.yml@@ -15,16 +15,16 @@ allOf:properties:self:allOf:- - $ref: "./link.yml"+ - $ref: './link.yml'- description: |-- This file links collection+ This project collection**Resource**: ProjectStorageCollectionModelrepresentations:type: arrayitems:allOf:- - $ref: "./link.yml"+ - $ref: './link.yml'- description: |-A project collection representation in a specific file format._embedded:diff --git a/docs/api/apiv3/components/schemas/user_collection_model.yml b/docs/api/apiv3/components/schemas/user_collection_model.ymlindex e6aa2ab589d..f803db5f7ac 100644--- a/docs/api/apiv3/components/schemas/user_collection_model.yml+++ b/docs/api/apiv3/components/schemas/user_collection_model.yml@@ -14,11 +14,11 @@ allOf:properties:self:allOf:- - $ref: "./link.yml"+ - $ref: './link.yml'- description: |-This user collection- **Resource**: UserCollectionModel+ **Resource**: Collection_embedded:type: objectrequired:diff --git a/docs/api/apiv3/components/schemas/user_model.yml b/docs/api/apiv3/components/schemas/user_model.ymlindex f93995ce4ac..4cce47faa1a 100644--- a/docs/api/apiv3/components/schemas/user_model.yml+++ b/docs/api/apiv3/components/schemas/user_model.yml@@ -1,201 +1,158 @@# Schema: UserModel----type: object-required:- - _type- - id- - name- - avatar- - _links-properties:- _type:- type: string- enum:- - User- id:- type: integer- description: User's id- minimum: 0- login:- type: string- description: |-- User's login name-- # Conditions-- **Permission**: Administrator, manage_user global permission- maxLength: 256- firstName:- type: string- description: |-- User's first name-- # Conditions-- **Permission**: Administrator, manage_user global permission- maxLength: 30- lastName:- type: string- description: |-- User's last name-- # Conditions-- **Permission**: Administrator, manage_user global permission- maxLength: 30- name:- type: string- description: User's full name, formatting depends on instance settings- email:- type: string- description: |-- User's email address-- # Conditions-- E-Mail address not hidden, **Permission**: Administrator, manage_user global permission- maxLength: 60- admin:- type: boolean- description: |-- Flag indicating whether or not the user is an admin-- # Conditions-- **Permission**: Administrator- avatar:- type: string- format: uri- description: URL to user's avatar- status:- type: string- description: The current activation status of the user (see below)- language:- type: string- description: |-- User's language | ISO 639-1 format-- # Conditions-- **Permission**: Administrator, manage_user global permission- identityUrl:- type:- - 'string'- - 'null'- description: |-- User's identity_url for OmniAuth authentication-- # Conditions-- **Permission**: Administrator- createdAt:- type: string- format: date-time- description: Time of creation- updatedAt:- type: string- format: date-time- description: Time of the most recent change to the user- _links:- type: object+allOf:+ - $ref: './principal_model.yml'+ - type: objectrequired:- - self- - memberships- - showUser+ - avatarproperties:- self:- allOf:- - "$ref": "./link.yml"- - description: |-- This user-- **Resource**: User- memberships:- allOf:- - "$ref": "./link.yml"- - description: |-- Link to collection of all the user's memberships. The list will only include the memberships in projects in which the requesting user has the necessary permissions.-- **Resource**: MemberCollection-- # Conditions-- **Permission**: view members or manage members in any project- showUser:- allOf:- - "$ref": "./link.yml"- - description: Link to the OpenProject user page (HTML)- updateImmediately:- allOf:- - "$ref": "./link.yml"- - description: |-- Updates the user's attributes.-- # Conditions-- **Permission**: Administrator, manage_user global permission- lock:- allOf:- - "$ref": "./link.yml"- - description: |-- Restrict the user from logging in and performing any actions-- # Conditions-- not locked; **Permission**: Administrator- unlock:- allOf:- - "$ref": "./link.yml"- - description: |-- Allow a locked user to login and act again-- # Conditions-- locked; **Permission**: Administrator- delete:- allOf:- - "$ref": "./link.yml"- - description: |-- Permanently remove a user from the instance-- # Conditions-- **Permission**: Administrator, self-delete--example:- _type: User- id: 1- name: John Sheppard- login: j.sheppard- firstName: John- lastName: Sheppard- email: [email protected]- admin: true- avatar: https://example.org/users/1/avatar- status: active- identityUrl: null,- language: en- createdAt: '2014-05-21T08:51:20.396Z'- updatedAt: '2014-05-21T08:51:20.396Z'- _links:- self:- href: '/api/v3/users/1'- title: John Sheppard- memberships:- href: /api/v3/memberships?filters=%5B%7B%22principal%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%221%22%5D%7D%7D%5D,- title: Members- showUser:- href: '/users/1'- type: text/html- lock:- href: '/api/v3/users/1/lock'- title: Set lock on John Sheppard- method: post- updateImmediately:- href: '/api/v3/users/1'- title: update John Sheppard- method: patch- delete:- href: '/api/v3/users/1'- title: delete John Sheppard- method: delete+ avatar:+ type: string+ format: uri+ description: URL to user's avatar+ login:+ type: string+ description: |-+ The user's login name++ # Conditions++ - User is self, or `create_user` or `manage_user` permission globally+ maxLength: 256+ firstName:+ type: string+ description: |-+ The user's first name++ # Conditions++ - User is self, or `create_user` or `manage_user` permission globally+ maxLength: 30+ lastName:+ type: string+ description: |-+ The user's last name++ # Conditions++ - User is self, or `create_user` or `manage_user` permission globally+ maxLength: 30+ email:+ type: string+ description: |-+ The user's email address++ # Conditions++ - E-Mail address not hidden+ - User is not a new record+ - User is self, or `create_user` or `manage_user` permission globally+ maxLength: 60+ admin:+ type: boolean+ description: |-+ Flag indicating whether or not the user is an admin++ # Conditions++ - `admin`+ status:+ type: string+ description: |-+ The current activation status of the user.++ # Conditions++ - User is self, or `create_user` or `manage_user` permission globally+ language:+ type: string+ description: |-+ User's language | ISO 639-1 format++ # Conditions++ - User is self, or `create_user` or `manage_user` permission globally+ identityUrl:+ type:+ - 'string'+ - 'null'+ description: |-+ User's identity_url for OmniAuth authentication.++ # Conditions++ - User is self, or `create_user` or `manage_user` permission globally+ createdAt:+ type: string+ format: date-time+ description: Time of creation+ updatedAt:+ type: string+ format: date-time+ description: Time of the most recent change to the user+ _links:+ type: object+ properties:+ showUser:+ allOf:+ - $ref: './link.yml'+ - description: |-+ A relative path to show the user in the web application.++ # Condition++ - User is not a new record+ - User is not `locked`+ updateImmediately:+ allOf:+ - $ref: './link.yml'+ - description: |-+ A link to update the user resource.++ # Conditions++ - `admin`+ lock:+ allOf:+ - $ref: './link.yml'+ - description: |-+ Restrict the user from logging in and performing any actions.++ # Conditions++ - User is not locked+ - `admin`+ unlock:+ allOf:+ - $ref: './link.yml'+ - description: |-+ Allow a locked user to login and act again.++ # Conditions++ - User is not locked+ - `admin`+ delete:+ allOf:+ - $ref: './link.yml'+ - description: |-+ Permanently remove a user from the instance++ # Conditions++ either:+ - `admin`+ - Setting `users_deletable_by_admin` is set+ or:+ - User is self+ - Setting `users_deletable_by_self` is set+ authSource:+ allOf:+ - $ref: './link.yml'+ - description: |-+ Permanently remove a user from the instance++ # Conditions++ - LDAP authentication configured+ - `admin`diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.ymlindex a5012089faf..b2d8b5b555c 100644--- a/docs/api/apiv3/openapi-spec.yml+++ b/docs/api/apiv3/openapi-spec.yml@@ -475,6 +475,8 @@ components:$ref: './components/examples/grid-simple-patch-model.yml'GridSimpleResponse:$ref: './components/examples/grid-simple-response.yml'+ GroupResponse:+ $ref: './components/examples/group-response.yml'MembershipCreateRequestCustomMessage:$ref: './components/examples/membership-create-request-custom-message.yml'MembershipCreateRequestGlobalRole:@@ -495,6 +497,8 @@ components:$ref: './components/examples/mentioned_notification.yml'NotificationCollection:$ref: './components/examples/notification_collection.yml'+ PlaceholderUserResponse:+ $ref: './components/examples/placeholder-user-response.yml'Project:$ref: './components/examples/project.yml'ProjectBody:@@ -511,6 +515,8 @@ components:$ref: './components/examples/status_collection.yml'StoragesSimpleCollectionModel:$ref: './components/examples/storages-simple-collection-response.yml'+ UserResponse:+ $ref: './components/examples/user-response.yml'ValuesPropertyStartDateSchema:$ref: './components/examples/values_property_start_date_schema.yml'ValuesPropertyDueDateSchema:@@ -669,12 +675,18 @@ components:"$ref": "./components/schemas/oauth_client_credentials_write_model.yml"PaginatedCollectionModel:"$ref": "./components/schemas/paginated_collection_model.yml"+ PlaceholderUserCollectionModel:+ "$ref": "./components/schemas/placeholder_user_collection_model.yml"+ PlaceholderUserModel:+ "$ref": "./components/schemas/placeholder_user_model.yml"Plain_TextModel:"$ref": "./components/schemas/plain_text_model.yml"PostModel:"$ref": "./components/schemas/post_model.yml"- PrincipalsModel:- "$ref": "./components/schemas/principals_model.yml"+ PrincipalCollectionModel:+ "$ref": "./components/schemas/principal_collection_model.yml"+ PrincipalModel:+ "$ref": "./components/schemas/principal_model.yml"PrioritiesModel:"$ref": "./components/schemas/priorities_model.yml"PriorityModel:diff --git a/docs/api/apiv3/paths/group.yml b/docs/api/apiv3/paths/group.ymlindex dae8e3c6988..2e181bd0daa 100644--- a/docs/api/apiv3/paths/group.yml+++ b/docs/api/apiv3/paths/group.yml@@ -79,6 +79,9 @@ get:application/hal+json:schema:$ref: '../components/schemas/group_model.yml'+ examples:+ 'group response':+ $ref: '../components/examples/group-response.yml''404':description: |-Returned if the group does not exist or if the API user does not have permission to view them.diff --git a/docs/api/apiv3/paths/placeholder_user.yml b/docs/api/apiv3/paths/placeholder_user.ymlnew file mode 100644index 00000000000..693abca4b10--- /dev/null+++ b/docs/api/apiv3/paths/placeholder_user.yml@@ -0,0 +1,157 @@+# /api/v3/placeholder_users/{id}+---+delete:+ summary: Delete placeholder user+ operationId: delete_placeholder_user+ description: Set the specified placeholder user to deleted status.+ tags:+ - Principals+ parameters:+ - description: Placeholder user id+ example: '1'+ in: path+ name: id+ required: true+ schema:+ type: integer+ responses:+ '204':+ description: Returned if the placeholder user was deleted successfully.+ '403':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission+ message: You are not allowed to delete the account of this user.+ description: |-+ Returned if the client does not have sufficient permissions.++ **Required permission:** `manage_placeholder_users`+ '404':+ description: Returned if the placeholder user does not exist.+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound+ message: The specified placeholder user does not exist.++get:+ summary: View placeholder user+ operationId: view_placeholder_user+ description: Return the placeholder user resource.+ tags:+ - Principals+ parameters:+ - description: The placeholder user id+ example: '1'+ in: path+ name: id+ required: true+ schema:+ type: string+ responses:+ '200':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/placeholder_user_model.yml'+ examples:+ 'placeholder user response':+ $ref: '../components/examples/placeholder-user-response.yml'+ description: OK+ '404':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound+ message: The specified placeholder user does not exist or you do not have permission to view them.+ description: |-+ Returned if the user does not exist or if the API user does not have permission to view them.++ **Required permission**: `manage_placeholder_users`++patch:+ summary: Update placeholder user+ operationId: update_placeholder_user+ tags:+ - Principals+ description: |-+ Updates the placeholder user's writable attributes.+ When calling this endpoint the client provides a single object, containing at least the properties and links+ that are required, in the body.+ parameters:+ - description: Placeholder user id+ example: '1'+ in: path+ name: id+ required: true+ schema:+ type: integer+ requestBody:+ content:+ application/json:+ schema:+ $ref: '../components/schemas/placeholder_user_create_model.yml'+ responses:+ '200':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/placeholder_user_model.yml'+ description: OK+ '400':+ $ref: "../components/responses/invalid_request_body.yml"+ '403':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission+ message: You are not allowed to update the account of this user.+ description: |-+ Returned if the client does not have sufficient permissions.++ **Required permission**: `manage_placeholder_users`+ '404':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound+ message: The specified placeholder user does not exist.+ description: |-+ Returned if the placeholder user does not exist.+ '406':+ $ref: "../components/responses/missing_content_type.yml"+ '415':+ $ref: "../components/responses/unsupported_media_type.yml"+ '422':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _embedded:+ details:+ attribute: name+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation+ message: Name has already been taken.+ description: |-+ Returned if:++ - the client tries to modify a read-only property (`PropertyIsReadOnly`)+ - a constraint for a property was violated (`PropertyConstraintViolation`)diff --git a/docs/api/apiv3/paths/placeholder_users.yml b/docs/api/apiv3/paths/placeholder_users.ymlnew file mode 100644index 00000000000..39bb3acccd1--- /dev/null+++ b/docs/api/apiv3/paths/placeholder_users.yml@@ -0,0 +1,108 @@+# /api/v3/placeholder_users+---+get:+ summary: List placehoder users+ operationId: list_placeholder_users+ tags:+ - Principals+ description: |-+ List all placeholder users. This can only be accessed if the requesting user has the global permission+ `manage_placeholder_user` or `manage_members` in any project.+ parameters:+ - name: filters+ description: |-+ JSON specifying filter conditions.+ Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint.+ Currently supported filters are:++ - name: filters placeholder users by the name.+ - group: filters placeholder by the group it is contained in.+ - status: filters placeholder by the status it has.+ in: query+ required: false+ schema:+ type: string+ example: '[{ "name": { "operator": "~", "values": ["Darth"] } }]'+ - name: select+ description: Comma separated list of properties to include.+ in: query+ required: false+ schema:+ type: string+ example: 'total,elements/name,elements/self,self'+ responses:+ '200':+ description: OK+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/principal_collection_model.yml'+ '400':+ description: Returned if the client sends invalid request parameters e.g. filters+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery+ message: Filters Invalid filter does not exist.++post:+ summary: Create placeholder user+ operationId: create_placeholder_user+ tags:+ - Principals+ description: |-+ Creates a new placeholder user. Only administrators and users with `manage_placeholder_user` global permission are+ allowed to do so. When calling this endpoint the client provides a single object, containing at least the+ properties and links that are required, in the body.+ requestBody:+ content:+ application/json:+ schema:+ $ref: '../components/schemas/placeholder_user_create_model.yml'+ responses:+ '201':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/placeholder_user_model.yml'+ description: Created+ '400':+ $ref: '../components/responses/invalid_request_body.yml'+ '403':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission+ message: You are not allowed to create new placeholder users.+ description: |-+ Returned if the client does not have sufficient permissions.++ **Required permission:** Administrator+ '406':+ $ref: '../components/responses/missing_content_type.yml'+ '415':+ $ref: '../components/responses/unsupported_media_type.yml'+ '422':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _embedded:+ details:+ attribute: name+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation+ message: Name has already been taken.+ description: |-+ Returned if:++ * a constraint for a property was violated (`PropertyConstraintViolation`)++diff --git a/docs/api/apiv3/paths/principals.yml b/docs/api/apiv3/paths/principals.ymlindex 1cdd47be770..bc4c25c856a 100644--- a/docs/api/apiv3/paths/principals.yml+++ b/docs/api/apiv3/paths/principals.yml@@ -1,141 +1,52 @@# /api/v3/principals---get:+ summary: List principals+ operationId: list_principals+ tags:+ - Principals+ description: |-+ List all principals. The client can choose to filter the principals similar to how work packages are filtered. In+ addition to the provided filters, the server will reduce the result set to only contain principals who are members+ in projects the client is allowed to see.parameters:- - description: |-- JSON specifying filter conditions.- Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint.- Currently supported filters are:-- + type: filters principals by their type (*User*, *Group*, *PlaceholderUser*).-- + member: filters principals by the projects they are members in.-- + name: filters principals by the user or group name.-- + any_name_attribute: filters principals by the user or group first- and last name, email or login.-- + status: filters principals by their status number (active = *1*, registered = *2*, locked = *3*, invited = *4*)- example: '[{ "type": { "operator": "=", "values": ["User"] } }]'- in: query- name: filters- required: false- schema:- type: string- - description: |-- Comma separated list of properties to include.- example: 'total,elements/name,elements/self,self'- in: query- name: select- required: false- schema:- type: string+ - name: filters+ description: |-+ JSON specifying filter conditions.+ Accepts the same format as returned by the [queries](https://www.openproject.org/docs/api/endpoints/queries/) endpoint.+ Currently supported filters are:++ - type: filters principals by their type (*User*, *Group*, *PlaceholderUser*).+ - member: filters principals by the projects they are members in.+ - name: filters principals by the user or group name.+ - any_name_attribute: filters principals by the user or group first- and last name, email or login.+ - status: filters principals by their status number (active = *1*, registered = *2*, locked = *3*, invited = *4*)+ in: query+ required: false+ schema:+ type: string+ example: '[{ "type": { "operator": "=", "values": ["User"] } }]'+ - name: select+ description: Comma separated list of properties to include.+ in: query+ required: false+ schema:+ type: string+ example: 'total,elements/name,elements/self,self'responses:'200':+ description: OKcontent:application/hal+json:- examples:- response:- value:- _embedded:- elements:- - _links:- delete:- href: "/api/v3/users/4"- method: delete- title: Delete Eliza92778- lock:- href: "/api/v3/users/4/lock"- method: post- title: Set lock on Eliza92778- self:- href: "/api/v3/users/4"- title: Danika O'Keefe- showUser:- href: "/users/4"- type: text/html- updateImmediately:- href: "/api/v3/users/4"- method: patch- title: Update Eliza92778- _type: User- admin: false- avatar: https://example.org/users/4/avatar- createdAt: '2015-03-20T12:57:02.901Z'- email: [email protected]- firstName: Danika- id: 4- identityUrl:- lastName: O'Keefe- login: Eliza92778- name: Danika O'Keefe- status: active- updatedAt: '2015-06-16T15:28:14.565Z'- - _links:- delete:- href: "/api/v3/users/2"- method: delete- title: Delete Sebastian9686- lock:- href: "/api/v3/users/2/lock"- method: post- title: Set lock on Sebastian9686- self:- href: "/api/v3/users/2"- title: Peggie Feeney- showUser:- href: "/users/2"- type: text/html- updateImmediately:- href: "/api/v3/users/2"- method: patch- title: Update Sebastian9686- _type: User- admin: false- avatar: https://example.org/users/4/avatar- createdAt: '2015-03-20T12:56:55.578Z'- email:- firstName: Peggie- id: 2- identityUrl:- lastName: Feeney- login: Sebastian9686- name: Peggie Feeney- status: active- updatedAt: '2015-03-20T12:56:55.254Z'- - _links:- self:- href: "/api/v3/groups/9"- title: The group- _type: Group- createdAt: '2015-09-23T11:06:36.231Z'- id: 9- name: The group- updatedAt: '2015-09-23T11:06:36.231Z'- - _links:- self:- href: "/api/v3/placeholder_users/29"- title: UX Designer- _type: PlaceholderUser- createdAt: '2018-09-23T11:06:36.231Z'- id: 29- name: UX Designer- updatedAt: '2019-10-23T11:06:36.231Z'- _links:- self:- href: "/api/v3/principals"- _type: Collection- count: 4- total: 4schema:- "$ref": "../components/schemas/principals_model.yml"- description: OK- headers: {}- tags:- - Principals- description: List all principals. The client can choose to filter the principals- similar to how work packages are filtered. In addition to the provided filters,- the server will reduce the result set to only contain principals who are members- in projects the client is allowed to see.- operationId: List_principals- summary: List principals+ $ref: '../components/schemas/principal_collection_model.yml'+ '400':+ description: Returned if the client sends invalid request parameters e.g. filters+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery+ message: Filters Invalid filter does not exist.diff --git a/docs/api/apiv3/paths/user.yml b/docs/api/apiv3/paths/user.ymlindex cd996fde062..b7e22c2c245 100644--- a/docs/api/apiv3/paths/user.yml+++ b/docs/api/apiv3/paths/user.yml@@ -6,6 +6,7 @@ delete:description: Permanently deletes the specified user account.tags:- Users+ - Principalsparameters:- description: User idexample: '1'@@ -51,6 +52,7 @@ get:description: ''tags:- Users+ - Principalsparameters:- description: User id. Use `me` to reference current user, if any.example: '1'@@ -65,6 +67,9 @@ get:application/hal+json:schema:$ref: '../components/schemas/user_model.yml'+ examples:+ 'user response':+ $ref: '../components/examples/user-response.yml'description: OK'404':content:@@ -85,6 +90,7 @@ patch:operationId: update_usertags:- Users+ - Principalsdescription: |-Updates the user's writable attributes.When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body.diff --git a/docs/api/apiv3/paths/users.yml b/docs/api/apiv3/paths/users.ymlindex b9036967c48..d31515008e2 100644--- a/docs/api/apiv3/paths/users.yml+++ b/docs/api/apiv3/paths/users.yml@@ -3,9 +3,15 @@get:summary: List UsersoperationId: list_Users- description: "Lists users. Only administrators or users with any of the following can access this resource: 'manage_members', 'manage_user', 'share_work_packages'."+ description: |-+ Lists users. Only administrators or users with any of the following can access this resource:++ - `manage_members`+ - `manage_user`+ - `share_work_packages`tags:- Users+ - Principalsparameters:- description: Page number inside the requested collection.example: '25'@@ -87,6 +93,7 @@ post:operationId: create_usertags:- Users+ - Principalsdescription: |-Creates a new user. Only administrators and users with manage_user global permission are allowed to do so.When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body.diff --git a/lib/api/v3/placeholder_users/placeholder_users_api.rb b/lib/api/v3/placeholder_users/placeholder_users_api.rbindex 4b986ac0e5d..012293616a5 100644--- a/lib/api/v3/placeholder_users/placeholder_users_api.rb+++ b/lib/api/v3/placeholder_users/placeholder_users_api.rb@@ -49,7 +49,7 @@ module APIget &::API::V3::Utilities::Endpoints::Show.new(model: PlaceholderUser).mountpatch &::API::V3::Utilities::Endpoints::Update.new(model: PlaceholderUser).mount- delete &::API::V3::Utilities::Endpoints::Delete.new(model: PlaceholderUser, success_status: 202).mount+ delete &::API::V3::Utilities::Endpoints::Delete.new(model: PlaceholderUser, success_status: 204).mountendendenddiff --git a/lib/api/v3/principals/principal_representer.rb b/lib/api/v3/principals/principal_representer.rbindex 33813ee011b..c02ef31d3db 100644--- a/lib/api/v3/principals/principal_representer.rb+++ b/lib/api/v3/principals/principal_representer.rb@@ -52,7 +52,7 @@ module API{href: api_v3_paths.path_for(:memberships, filters:),- title: I18n.t(:label_member_plural)+ title: I18n.t(:label_membership_plural)}end