travis-api/lib/travis/services/find_user_permissions.rb
Aakriti Gupta c6a1eda572 Move travis-core files from /vendor to /lib.
- Re-factor
- Remove code for notifications
- Remove addons
- Remove travis-core gem.
- Ignore logs directory only
- Move core tests to spec/lib
2016-07-28 15:09:08 +02:00

16 lines
318 B
Ruby

require 'travis/services/base'
module Travis
module Services
class FindUserPermissions < Base
register :find_user_permissions
def run
scope = current_user.permissions
scope = scope.by_roles(params[:roles].to_s.split(',')) if params[:roles]
scope
end
end
end
end