gitlab-org--gitlab-foss/lib/api/helpers/members_helpers.rb
Rémy Coutable 81ba3f9177
API: Introduce #find_group! which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 16:58:32 +01:00

13 lines
286 B
Ruby

module API
module Helpers
module MembersHelpers
def find_source(source_type, id)
public_send("find_#{source_type}!", id)
end
def authorize_admin_source!(source_type, source)
authorize! :"admin_#{source_type}", source
end
end
end
end