Skip to content

Commit

Permalink
fix(metadata): modify permissions check on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Jan 13, 2025
1 parent 3767664 commit 4bb8ccd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/placeos-rest-api/controllers/metadata.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ module PlaceOS::Api
###############################################################################################

# Does the user making the request have permissions to modify the data
@[AC::Route::Filter(:before_action, only: [:destroy])]
def check_delete_permissions(
@[AC::Param::Info(name: "id", description: "the parent id of the metadata to be destroyed")]
@[AC::Route::Filter(:before_action, only: [:update, :destroy])]
def check_modify_permissions(
@[AC::Param::Info(name: "id", description: "the parent id of the metadata to be modified")]
parent_id : String
)
return if user_support? || parent_id == user_token.id
Expand Down

0 comments on commit 4bb8ccd

Please sign in to comment.