docbrown/app
Julianna Tetreault 71b35f28a0
Remove Roles via Admin (#12582) [deploy]
* Add the ability to remove a role from a non-super_admin in Admin::UsersController
 - Adds a #destroy action to the Admin::UsersController
 - Adds a destroy route for the action

* Add a removal button to non-super_admin roles on admin user pages
  - Pulls Current Roles out of _activity and into own partial
  - Adds a _current_roles partial to /admin/users/show
  - Adds REMOVE buttons to non-super_admin roles
  - Conditionally renders REMOVE buttons for certain roles only

* Add tests around the removal of roles to users_manage_spec

* Adjust formatting of link_to in _current_roles.html.erb

* Use :aggregate_failures in role-related tests in users_manage_spec.rb

* Refactors Admin::UsersController#destroy and role params

* Update admin/users_spec.rb to take into account _current_roles partial

* Replace REMOVE text with X on role removal buttons

* Add additional elsif to handle single_resource_admin removal
  - Adds resource_type params to Admin::UsersController
  - Adds elsif to handle removal of single_resource_admin roles
  - Adds resource_type to the removal button in _current_roles
  - Adds a spec around removing single_resource_admin roles

* Add .constantize to resource_type in Admin::UsersController

* Move .constantize to resource_type arg rather than params in #destroy

* Use .safe_constantize rather than .constantize for params[:resource_type]

* Remove .safe_constantize from params and onto inline var instead

* Add nil check to removal of :single_resource_admin role in #destroy

* Update users_manage_spec.rb to remove proper role in test

* Add resource_name to current user and super admin _current_roles list

* Add additional test around removing :single_resource_admin role
2021-02-16 10:50:10 -07:00
..
assets CSS size reduce + cleanups. (#12625) 2021-02-16 13:44:26 +01:00
black_box Small adjustment to blackbox.rb (#10961) 2020-10-20 21:14:56 -04:00
controllers Remove Roles via Admin (#12582) [deploy] 2021-02-16 10:50:10 -07:00
decorators Fix profile field production display area functionality and remove SiteConfig.dev_to? hacks for better generalization (#12015) 2021-02-11 10:05:06 -05:00
errors Prevent suspended users from self-deleting and returning (#12503) 2021-02-11 09:28:59 +07:00
helpers Navigation Items and Role access for Data Update Scripts (#12292) 2021-02-09 17:41:14 +02:00
javascript bugfix (#12703) 2021-02-16 15:50:37 +01:00
lib Navigation Items and Role access for Data Update Scripts (#12292) 2021-02-09 17:41:14 +02:00
liquid_tags Bump liquid from 4.0.3 to 5.0.0 (#12150) 2021-01-15 15:37:42 -06:00
mailers Email confirmation to abuse reports (#12557) 2021-02-03 22:59:50 +03:00
middlewares Move TimeZoneSetter middleware in proper place (#11336) 2020-11-09 17:11:10 +01:00
models Drop language settings columns (#12699) 2021-02-16 23:29:44 +07:00
policies Remove feed admin publish permission (#12483) 2021-02-04 13:13:35 +00:00
queries/admin Filter by a few other roles when adding potential mods (#11187) 2020-11-02 15:05:19 -05:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Video max width (#12436) 2021-01-26 15:12:37 +01:00
serializers Remove language settings (#12502) 2021-02-04 08:35:00 +07:00
services Parenthesis consistency for add_role and remove_role (#12661) 2021-02-15 20:35:25 +02:00
uploaders Refactor:Change Image Article Upload Path to uploads/articles (#12668) 2021-02-15 11:52:00 -06:00
validators Add validations to SiteConfig model (#12341) 2021-01-26 09:12:24 +07:00
view_objects Move GeneratedImage to Images::GenerateSocialmage (#11691) 2020-12-02 11:03:14 +07:00
views Remove Roles via Admin (#12582) [deploy] 2021-02-16 10:50:10 -07:00
workers Add guard clause to worker (#12632) 2021-02-11 10:43:48 +07:00