Bug #16828

Cloned roles should have `builtin` value 0

Added by Swapnil Abnave 8 months ago. Updated 4 months ago.

Status:Closed
Priority:Low
Assigned To:Swapnil Abnave
Category:Authorization
Target version:Team Anurag Iteration 6
Difficulty:trivial Bugzilla link:1378544
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3925
Story points-
Velocity based estimate-
Release1.14.0Release relationshipAuto

Description

Ensure that `role.builtin` for cloned roles is always 0.

This is because `role.builtin` is being assigned a boolean value whereas the PG datatype is INTEGER.

https://github.com/theforeman/foreman/blob/develop/app/controllers/roles_controller.rb#L97

The attached bugzilla is not reproducable as upstream is fixed by commit: https://github.com/theforeman/foreman/blob/12612809c5deb885b13ceaf36b6a147c21688eb5/db/migrate/20160715131352_set_role_builtin_default.rb


Related issues

Related to Foreman - Feature #18321: Provide migration to fix cloned roles Closed 01/31/2017
Related to Foreman - Refactor #15621: Change role builtin attribute to boolean New 07/08/2016

Associated revisions

Revision c94fc6bd
Added by Swapnil Abnave 8 months ago

Fixes #16828 - cloned-roles - role.builtin must be 0

History

#1 Updated by The Foreman Bot 8 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3925 added

#2 Updated by Dominic Cleal 8 months ago

  • Category set to Authorization
  • Release set to 1.14.0

#3 Updated by Swapnil Abnave 8 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Swapnil Abnave 7 months ago

  • Target version set to Team Anurag backlog

#5 Updated by Swapnil Abnave 6 months ago

  • Target version changed from Team Anurag backlog to Team Anurag Iteration 6

#6 Updated by Lukas Zapletal 4 months ago

  • Related to Feature #18321: Provide migration to fix cloned roles added

#7 Updated by Lukas Zapletal 4 months ago

Workaround (for googlers):

echo "Role.where(:builtin => nil).update_all(:builtin => 0)" | foreman-rake console

To fix all cloned roles.

#8 Updated by Dominic Cleal about 1 month ago

  • Related to Refactor #15621: Change role builtin attribute to boolean added

Also available in: Atom PDF