Method: Aptible::Auth::Role#set_account_permissions
- Defined in:
- lib/aptible/auth/role.rb
#set_account_permissions(account, scopes) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/aptible/auth/role.rb', line 18 def (account, scopes) = (account) .each { |p| p.destroy unless scopes.include? p.scope } existing = .keep_if { |p| scopes.include? p.scope } new_scopes = scopes - existing.map(&:scope) add_account_scopes(account, new_scopes) end |