-
Notifications
You must be signed in to change notification settings - Fork 1
admin permissions #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
admin permissions #338
Changes from all commits
ca0db8d
ab11279
e064437
6f7256d
a887d58
db66b08
e6b6d37
00c6a3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2449,6 +2449,73 @@ | |
| } | ||
| } | ||
| }, | ||
| "/api/v1/trips/{tripID}/activities/{activityID}/rsvps/{userID}": { | ||
| "delete": { | ||
| "description": "Removes a user's RSVP from an activity. Only the activity proposer or a trip admin can remove another user's RSVP.", | ||
| "tags": [ | ||
| "activities" | ||
| ], | ||
| "summary": "Remove activity RSVP", | ||
| "parameters": [ | ||
| { | ||
| "type": "string", | ||
| "description": "Trip ID", | ||
| "name": "tripID", | ||
| "in": "path", | ||
| "required": true | ||
| }, | ||
| { | ||
| "type": "string", | ||
| "description": "Activity ID", | ||
| "name": "activityID", | ||
| "in": "path", | ||
| "required": true | ||
| }, | ||
| { | ||
| "type": "string", | ||
| "description": "User ID of the RSVP to remove", | ||
| "name": "userID", | ||
| "in": "path", | ||
| "required": true | ||
| } | ||
| ], | ||
| "responses": { | ||
| "204": { | ||
| "description": "No Content" | ||
| }, | ||
| "400": { | ||
| "description": "Bad Request", | ||
| "schema": { | ||
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| }, | ||
| "401": { | ||
| "description": "Unauthorized", | ||
| "schema": { | ||
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| }, | ||
| "403": { | ||
| "description": "Forbidden", | ||
| "schema": { | ||
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| }, | ||
| "404": { | ||
| "description": "Not Found", | ||
| "schema": { | ||
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| }, | ||
| "500": { | ||
| "description": "Internal Server Error", | ||
| "schema": { | ||
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/api/v1/trips/{tripID}/activity": { | ||
| "get": { | ||
| "description": "Returns all unread events in the caller's trip feed. Events persist until explicitly dismissed via the mark-read endpoint.", | ||
|
|
@@ -3115,7 +3182,7 @@ | |
| } | ||
| }, | ||
| "delete": { | ||
| "description": "Removes a user from a trip", | ||
| "description": "Removes a user from a trip. Only admins can remove members.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Authorization description is incorrect for membership removal. Line 3185 states that only admins can remove members, but this endpoint also allows users to remove themselves. This creates an inaccurate API contract for clients and test expectations. Proposed doc fix- "description": "Removes a user from a trip. Only admins can remove members.",
+ "description": "Removes a user from a trip. Caller must be a trip admin or the target user themself.",🤖 Prompt for AI Agents |
||
| "tags": [ | ||
| "memberships" | ||
| ], | ||
|
|
@@ -3153,6 +3220,12 @@ | |
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| }, | ||
| "403": { | ||
| "description": "Forbidden", | ||
| "schema": { | ||
| "$ref": "#/definitions/errs.APIError" | ||
| } | ||
| }, | ||
| "404": { | ||
| "description": "Not Found", | ||
| "schema": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3517,6 +3517,52 @@ paths: | |||||||||
| summary: Get activity RSVPs | ||||||||||
| tags: | ||||||||||
| - activities | ||||||||||
| /api/v1/trips/{tripID}/activities/{activityID}/rsvps/{userID}: | ||||||||||
| delete: | ||||||||||
| description: Removes a user's RSVP from an activity. Only the activity proposer | ||||||||||
| or a trip admin can remove another user's RSVP. | ||||||||||
| parameters: | ||||||||||
| - description: Trip ID | ||||||||||
| in: path | ||||||||||
| name: tripID | ||||||||||
| required: true | ||||||||||
| type: string | ||||||||||
| - description: Activity ID | ||||||||||
| in: path | ||||||||||
| name: activityID | ||||||||||
| required: true | ||||||||||
| type: string | ||||||||||
| - description: User ID of the RSVP to remove | ||||||||||
| in: path | ||||||||||
| name: userID | ||||||||||
| required: true | ||||||||||
| type: string | ||||||||||
| responses: | ||||||||||
| "204": | ||||||||||
| description: No Content | ||||||||||
| "400": | ||||||||||
| description: Bad Request | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| "401": | ||||||||||
| description: Unauthorized | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| "403": | ||||||||||
| description: Forbidden | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| "404": | ||||||||||
| description: Not Found | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| "500": | ||||||||||
| description: Internal Server Error | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| summary: Remove activity RSVP | ||||||||||
| tags: | ||||||||||
| - activities | ||||||||||
| /api/v1/trips/{tripID}/activities/parse-link: | ||||||||||
| post: | ||||||||||
| consumes: | ||||||||||
|
|
@@ -3978,7 +4024,7 @@ paths: | |||||||||
| - memberships | ||||||||||
| /api/v1/trips/{tripID}/memberships/{userID}: | ||||||||||
| delete: | ||||||||||
| description: Removes a user from a trip | ||||||||||
| description: Removes a user from a trip. Only admins can remove members. | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Description is incomplete: self-removal is also permitted. Per the PR objectives, the caller may be an admin or the user themself. The current text ("Only admins can remove members") would mislead API consumers into thinking a member cannot leave a trip via this endpoint. Proposed wording- description: Removes a user from a trip. Only admins can remove members.
+ description: Removes a user from a trip. Only a trip admin or the user
+ themself can perform this action. The last remaining admin cannot be
+ removed.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| operationId: removeMember | ||||||||||
| parameters: | ||||||||||
| - description: Trip ID | ||||||||||
|
|
@@ -4002,6 +4048,10 @@ paths: | |||||||||
| description: Unauthorized | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| "403": | ||||||||||
| description: Forbidden | ||||||||||
| schema: | ||||||||||
| $ref: '#/definitions/errs.APIError' | ||||||||||
| "404": | ||||||||||
| description: Not Found | ||||||||||
| schema: | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Authorization description is incorrect for membership removal.
Line 3191 says only admins can remove members, but this endpoint also allows users to remove themselves. Please update the annotation/source comment and regenerate Swagger so the contract matches runtime behavior.
Suggested documentation fix
🤖 Prompt for AI Agents