Skip to content

Conversation

jrafanie
Copy link
Member

Using params for the action rbac_tenant_delete is correct for this action.

It should not be used for any role_allows? calls as they can be for doing different actions/product features. For example, after deleting a tenant, the subsequent call to replace the right cell and update the screen after the deletion should not refer to an already deleted tenant.

Fixes #9512. Replaces #9523

Using params for the action rbac_tenant_delete is correct for this action.

It should not be used for any role_allows? calls as they can be for doing
different actions/product features.  For example, after deleting a tenant,
the subsequent call to replace the right cell and update the screen after
the deletion should not refer to an already deleted tenant.

Fixes ManageIQ#9512
@jrafanie
Copy link
Member Author

cool, tests failed... looking

end

if MiqProductFeature.my_root_tenant_identifier?(options[:feature]) && self.x_node.to_s.start_with?("tn-")
_, id, _ = TreeBuilder.extract_node_model_and_id(self.x_node.to_s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus whitespace

Suggested change
_, id, _ = TreeBuilder.extract_node_model_and_id(self.x_node.to_s)
_, id, _ = TreeBuilder.extract_node_model_and_id(self.x_node.to_s)

@jrafanie
Copy link
Member Author

jrafanie commented Jul 24, 2025

cool, tests failed... looking

will need to look at this later... it looks like basic button role_allows_feature? expects to be able to pull out the controller's params id to check if the role_allows the button action. Note, we don't actually pass the tenant id to the button, it pulls it from the controller's params. 😭

What a mess:
#5123
#5129
#5142

I have concern other areas may also rely on checking the controller's params. 🤷

@jrafanie jrafanie changed the title Extract the tenant id from the x_node [WIP] Extract the tenant id from the x_node Jul 24, 2025
@Fryguy
Copy link
Member

Fryguy commented Jul 24, 2025

Ugh, ok. We may have to detangle this one together and/or find a way to drop that role_allows? override.

@Fryguy Fryguy added the wip label Jul 24, 2025
@jrafanie jrafanie closed this Aug 13, 2025
@jrafanie
Copy link
Member Author

After a discuss with @Fryguy a few weeks ago, a surgical #9523 is probably better than for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting a tenant raises an Server Error
2 participants