Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Catalog] Feature- Remove or hide delete option from menu (Headers) #5639

Closed
MiguelRamBalt opened this issue May 11, 2021 · 8 comments
Closed
Labels
enhancement New feature or request stale

Comments

@MiguelRamBalt
Copy link
Contributor

MiguelRamBalt commented May 11, 2021

We want to delete the menu from the header in catalog when you select an Api.

Possible Implementation

We can add a configuration in app-config.yalm file under the catalog section, and then We can create a hook in order to read that specific configuration.

Context

We want to create that menu configurable because we are planning to delete entities from another section, so We can modify that section just adding or removing a attribute.

@MiguelRamBalt MiguelRamBalt added the enhancement New feature or request label May 11, 2021
@timbonicus
Copy link
Contributor

timbonicus commented May 12, 2021

To be clear, are you talking about hiding the context menu shown here, only for API kinds?

catalog-context-menu

And is the desire to hide the whole menu, including other things that may be in there, or only to disable the Unregister entity option? Perhaps something like a readonly flag for an entity or access control as in #3218 could signal that unregister is not available as an option (and be manually overriden elsewhere)?

@MiguelRamBalt
Copy link
Contributor Author

MiguelRamBalt commented May 12, 2021

Hi @timbonicus !

Yep that's the whole menu We want to hide, that's because We customize each entity using EntityPageLayout and We give the right access to each user in that way. We currently working on a contribution but I'm little blocked because I'm using this pattern const config = useApi(configApiRef); const supportConfig = config.getOptionalConfig('catalog'); in order to get that configuration from app-config.yalm file, but I can't get the configuration from that file and I don't know if that is the right solution.
I would like to know you point of view about that.

Thanks!

@MiguelRamBalt
Copy link
Contributor Author

@timbonicus I created this PR #5662 regarding this enhancement.

@timbonicus
Copy link
Contributor

timbonicus commented May 13, 2021

Sorry, I'm still finding this quite unclear. Hiding the menu itself doesn't seem like the right approach. I was proposing a way to mark certain catalog entities as forbidden to unregister. Then, as a byproduct, the menu item (and perhaps the whole menu if that's the only menu item) goes away.

We customize each entity using EntityPageLayout and We give the right access to each user in that way

Would you mind describing your use case a bit? Do you mean that you want RBAC for catalog entities, where access to unregister is only available to certain users?

To your other question, the config should be exposed by the relevant plugin (catalog, in this case) rather than in the core package. You can see the current catalog configuration available from catalog-backend, but this would be frontend config so a similar config.d.ts file in plugins/catalog instead.

But again, adding a flag to hide something on the UI doesn't seem like the right approach. This wouldn't prevent backend calls from still succeeding, for example. That would be better accomplished with something like the readonly catalog flag. You said originally that you want to hide it for API kinds specifically, which a generic flag doesn't achieve either.

It seems like either a readonly field on entity metadata, or entity RBAC, would be the right solution depending on your use case.

@MiguelRamBalt
Copy link
Contributor Author

Hi @timbonicus

Answering your questions, We want to remove that menu for all entities, inside of each entity We are going to determine if the user have access to delete. The approach you suggest is a little hard to implement that because we need to modify all the entities already created and pass that property for each of them., Currently We are working on create a users groups and map to them the entities. That's way We give this proposal.

@MiguelRamBalt
Copy link
Contributor Author

this is another issue related to #5658

@stale
Copy link

stale bot commented Jul 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 16, 2021
@stale
Copy link

stale bot commented Sep 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2021
@stale stale bot closed this as completed Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants