Bug #21030
closedUnable to delete users logged in via ldap usergroups with org and/or loc set
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1483240
Description of problem:
Unable to delete users logged in via ldap usergroups with org and loc set
How reproducible:
Steps to Reproduce:
1. Create a ldap-auth-source with org and loc
2. create a usergroup and add external user-group to it
3. login to sat6 via a user belonging to the user-group added in step 2.
Actual results:
Unable to delete users logged in via ldap usergroups with org and loc set
Oops, we're sorry but something went wrong "Unknown member type"
2017-08-19 10:11:25 9c97c263 [app] [I] Current user: admin (administrator)
2017-08-19 10:11:26 9c97c263 [app] [W] Action failed
| ArgumentError: Unknown member type
| /usr/share/foreman/app/models/usergroup_member.rb:108:in `find_all_affected_memberships_for'
| /usr/share/foreman/app/models/usergroup_member.rb:96:in `find_all_affected_memberships'
| /usr/share/foreman/app/models/usergroup_member.rb:69:in `recache_memberships'
| /usr/share/foreman/app/models/usergroup_member.rb:65:in `remove_old_cache'
| /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
| /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:228:in `block in halting_and_conditional'
| /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:506:in `block in call'
2017-08-19 10:11:26 9c97c263 [app] [I] Deface: [WARNING] No :original defined for 'change 500 page content', you should change its definition to include:
| :original => '35d2b4f7aac0c083740c6de6775473457e9ae9d8'
2017-08-19 10:11:26 9c97c263 [app] [I] Rendered common/500.html.erb within layouts/application (11.5ms)
2017-08-19 10:11:26 9c97c263 [app] [I] Rendered layouts/_application_content.html.erb (0.7ms)
2017-08-19 10:11:26 9c97c263 [app] [I] Rendered layouts/base.html.erb (3.4ms)
2017-08-19 10:11:26 9c97c263 [app] [I] Completed 500 Internal Server Error in 156ms (Views: 26.7ms | ActiveRecord: 20.8ms)
This issue is only seen for users from ldap auth source , for both when only organization is set and also when location is set.
Expected results:
Should be able to delete users logged in via ldap usergroups with org and loc context set.
Additional info: