Commit 33369c5f authored by mgabdev's avatar mgabdev

Added authorization to pin group statuses

• Added:
- authorization to pin group statuses
parent 9b044f23
......@@ -11,11 +11,15 @@ class Api::V1::Groups::PinsController < Api::BaseController
respond_to :json
def create
authorize @group, :update?
GroupPinnedStatus.create!(group: @group, status: @status)
render json: @status, serializer: REST::StatusSerializer
end
def destroy
authorize @group, :update?
pin = GroupPinnedStatus.find_by(group: @group, status: @status)
if pin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment