Project

General

Custom queries

Profile

Actions

Bug #16828

closed

Cloned roles should have `builtin` value 0

Added by Swapnil Abnave over 8 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Low
Category:
Users, Roles and Permissions
Target version:
Difficulty:
trivial
Triaged:
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 2 (1 open1 closed)

Related to Foreman - Feature #18321: Provide migration to fix cloned rolesClosedLukas Zapletal01/31/2017Actions
Related to Foreman - Refactor #15621: Change role builtin attribute to booleanNew07/08/2016Actions
Actions #3

Updated by Swapnil Abnave over 8 years ago

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

Updated by Lukas Zapletal about 8 years ago

Workaround (for googlers):

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

To fix all cloned roles.

Actions

Also available in: Atom PDF