Skip to content

Commit

Permalink
chore(modules): destroy permissions were missed
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Aug 22, 2023
1 parent e6a4d20 commit 52839a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/placeos-rest-api/controllers/modules.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module PlaceOS::Api
before_action :can_read, only: [:index, :show]
before_action :can_write, only: [:create, :update, :destroy, :remove]

before_action :check_admin, except: [:index, :create, :update, :state, :show, :ping, :start, :stop]
before_action :check_admin, except: [:index, :create, :update, :destroy, :state, :show, :ping, :start, :stop]
before_action :check_support, only: [:state, :show, :ping]

###############################################################################################
Expand Down Expand Up @@ -261,6 +261,7 @@ module PlaceOS::Api
# remove a module
@[AC::Route::DELETE("/:id", status_code: HTTP::Status::ACCEPTED)]
def destroy : Nil
can_modify?(current_module)
current_module.destroy
end

Expand Down

0 comments on commit 52839a2

Please sign in to comment.