Added authorization to pin group statuses
• Added: - authorization to pin group statuses
This commit is contained in:
parent
9b044f233a
commit
33369c5fbf
@ -11,11 +11,15 @@ class Api::V1::Groups::PinsController < Api::BaseController
|
|||||||
respond_to :json
|
respond_to :json
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
authorize @group, :update?
|
||||||
|
|
||||||
GroupPinnedStatus.create!(group: @group, status: @status)
|
GroupPinnedStatus.create!(group: @group, status: @status)
|
||||||
render json: @status, serializer: REST::StatusSerializer
|
render json: @status, serializer: REST::StatusSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
authorize @group, :update?
|
||||||
|
|
||||||
pin = GroupPinnedStatus.find_by(group: @group, status: @status)
|
pin = GroupPinnedStatus.find_by(group: @group, status: @status)
|
||||||
|
|
||||||
if pin
|
if pin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user