Commit 59e7c39f authored by http://jneen.net/'s avatar http://jneen.net/

use subject scope in :id/users

since we're loading all the members anyways
parent e895b49f
require 'declarative_policy'
module API module API
# Projects API # Projects API
class Projects < Grape::API class Projects < Grape::API
...@@ -396,7 +398,7 @@ module API ...@@ -396,7 +398,7 @@ module API
use :pagination use :pagination
end end
get ':id/users' do get ':id/users' do
users = user_project.team.users users = DeclarativePolicy.subject_scope { user_project.team.users }
users = users.search(params[:search]) if params[:search].present? users = users.search(params[:search]) if params[:search].present?
present paginate(users), with: Entities::UserBasic present paginate(users), with: Entities::UserBasic
......
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