Sha256: 84115b3382ff0f0b452319916e50af185176453fccdffe44fb04c1e6274977aa

Contents?: true

Size: 746 Bytes

Versions: 18

Compression:

Stored size: 746 Bytes

Contents

class Maestrano::Account::GroupUsersController < Maestrano::Rails::WebHookController
  # DELETE /maestrano/account/groups/cld-1/users/usr-1/tenant
  # Remove a user from a group
  def destroy
    # Set the right uid based on Maestrano.param('sso.creation_mode')
    user_uid = Maestrano.mask_user(params[:id], params[:group_id])
    group_uid = params[:group_id]

    # Get the entities
    user = Maestrano::Connector::Rails::User.find_by_uid_and_tenant(user_uid, params[:tenant] || 'default')
    organization = Maestrano::Connector::Rails::Organization.find_by_uid_and_tenant(group_uid, params[:tenant] || 'default')

    # Remove the user from the organization
    organization.remove_member(user)

    render json: {success: true}
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC8 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.5.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC7 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC6 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC5 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC4 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-2.0.0.pre.RC1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.4.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.3.5 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.3.4 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.3.3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.3.2 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.3.1 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.3.0 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.2.3 app/controllers/maestrano/account/group_users_controller.rb
maestrano-connector-rails-1.2.2 app/controllers/maestrano/account/group_users_controller.rb