Project

General

Profile

Actions

Bug #28413

closed

Creating a new product by limited permissions user fails with error "NoMethodError: undefined method `[]' for nil:NilClass"

Added by Partha Aji over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Roles and Permissions
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by Partha Aji over 4 years ago

  • Bugzilla link set to 1771937
Actions #2

Updated by The Foreman Bot over 4 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
Actions #3

Updated by Chris Roberts over 4 years ago

  • Category set to Roles and Permissions
  • Target version set to Katello 3.15.0
  • Triaged changed from No to Yes
Actions #4

Updated by The Foreman Bot over 4 years ago

  • Fixed in Releases Katello 3.15.0 added
Actions #5

Updated by Partha Aji over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF