Project

General

Profile

Bug #16828

Cloned roles should have `builtin` value 0

Added by Swapnil Abnave over 2 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Low
Category:
Authorization
Target version:
Difficulty:
trivial
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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 rolesClosed2017-01-31
Related to Foreman - Refactor #15621: Change role builtin attribute to booleanNew2016-07-08

Associated revisions

Revision c94fc6bd (diff)
Added by Swapnil Abnave over 2 years ago

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

History

#1 Updated by The Foreman Bot over 2 years ago

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

#2 Updated by Dominic Cleal over 2 years ago

  • Category set to Authorization
  • Legacy Backlogs Release (now unused) set to 189

#3 Updated by Swapnil Abnave over 2 years ago

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

#4 Updated by Swapnil Abnave over 2 years ago

  • Target version set to 1.15.6

#5 Updated by Swapnil Abnave over 2 years ago

  • Target version changed from 1.15.6 to 1.15.1

#6 Updated by Lukas Zapletal over 2 years ago

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

#7 Updated by Lukas Zapletal over 2 years 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 2 years ago

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

Also available in: Atom PDF