Bug #28413
closedCreating a new product by limited permissions user fails with error "NoMethodError: undefined method `[]' for nil:NilClass"
Description
Creating a new product by limited permissions user fails with error "NoMethodError: undefined method `[]' for nil:NilClass"
The user has been assigned to a custom role with the following filter :
Resource Permissions Search
Product and Repositories export_products, N/A
sync_products,
destroy_products,
edit_products,
create_products,
view_products
The product is created even with the error on step "Actions::Katello::Product::ReindexSubscriptions" and the task becomes on paused state and the product can not be deleted until cleaning up the task.
The product is successfully created with no errors when the following filter is added to the role:
Resource Permissions
Subscription view_subscriptions
How reproducible:
100%
Steps to Reproduce:
1.Create a role ROLE1 with the following filters :
Resource Permissions Search
Product and Repositories export_products, N/A
sync_products,
destroy_products,
edit_products,
create_products,
view_products
2. Create a new user and assign ROLE1 to it.
3.Login using the new user and try to create a new product.
Actual results:
The product is created but with the following error and the task becomes on paused state.
An error occurred while saving the Product: 0 Task XXXXX: NoMethodError: undefined method `[]' for nil:NilClass
Expected results:
If a subscription permission is needed , the product creation task can not be started or exit with clear error.
Additional info:
The product is successfully created with no errors when the following filter is added to the role:
Resource Permissions
Subscription view_subscriptions
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Assignee set to Partha Aji
- Pull request https://github.com/Katello/katello/pull/8458 added
Updated by Chris Roberts about 5 years ago
- Category set to Roles and Permissions
- Target version set to Katello 3.15.0
- Triaged changed from No to Yes
Updated by The Foreman Bot about 5 years ago
- Fixed in Releases Katello 3.15.0 added
Updated by Partha Aji about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|7132721109753672327386f9c5bce441ae0020eb.