Add finer permission requirements for managing webhooks (#25463)
This commit is contained in:
		@@ -28,6 +28,7 @@ module Admin
 | 
			
		||||
      authorize :webhook, :create?
 | 
			
		||||
 | 
			
		||||
      @webhook = Webhook.new(resource_params)
 | 
			
		||||
      @webhook.current_account = current_account
 | 
			
		||||
 | 
			
		||||
      if @webhook.save
 | 
			
		||||
        redirect_to admin_webhook_path(@webhook)
 | 
			
		||||
@@ -39,6 +40,8 @@ module Admin
 | 
			
		||||
    def update
 | 
			
		||||
      authorize @webhook, :update?
 | 
			
		||||
 | 
			
		||||
      @webhook.current_account = current_account
 | 
			
		||||
 | 
			
		||||
      if @webhook.update(resource_params)
 | 
			
		||||
        redirect_to admin_webhook_path(@webhook)
 | 
			
		||||
      else
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user