RedHatInsights / sources-ui

Static deploy repo: https://github.com/RedHatInsights/sources-ui-deploy
Apache License 2.0
5 stars 47 forks source link

Customize Integrations landing page for unauthorized users #1246

Closed radekkaluzik closed 1 week ago

radekkaluzik commented 2 weeks ago

Description

Integrations landing page hides "create new integration" functionality for unauthorized users

RHCLOUD-35362


Screenshots

Snímek obrazovky 2024-10-07 v 15 01 20

Snímek obrazovky 2024-10-07 v 15 49 26


Checklist ☑️

radekkaluzik commented 1 week ago

/retest

fhlavac commented 1 week ago

Per the ticket description, these should be probably hidden as well

Snímek obrazovky 2024-10-09 v 9 57 35
karelhala commented 1 week ago

/retest

radekkaluzik commented 1 week ago

Per the ticket description, these should be probably hidden as well

Snímek obrazovky 2024-10-09 v 9 57 35

All those things are hidden. Karel created testing account "integrations-frontend" to simulate unauthorized user. All those elements you've highlighted are hidden as requested.

fhlavac commented 1 week ago

Per the ticket description, these should be probably hidden as well

 Snímek obrazovky 2024-10-09 v 9 57 35 All those things are hidden. Karel created testing account "integrations-frontend" to simulate unauthorized user. All those > elements you've highlighted are hidden as requested.

Oh yeah, I see it now, I have overwritten the permissions in one place and affected only the dropdown. Just seeing this now I wonder if it won't be more efficient to do the permission check in one place and not duplicate the code in two places. Something similar is already being done here https://github.com/RedHatInsights/sources-ui/blob/master/src/pages/Sources.js#L71 so maybe we could enhance it, remove the other checks and just pass the result of the permission check down to the header and overview content. What do you think?

radekkaluzik commented 1 week ago

Authorized user authorized_user

Unauthorized user unauthorized_user