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

Bug 1833146: Hide Project Access Tab when the user have no access to role bindings #5350

Merged

Conversation

debsmita1
Copy link
Contributor

@debsmita1 debsmita1 commented May 7, 2020

Fixes
https://issues.redhat.com/browse/ODC-3733

Root Cause/Analysis
Previously Project Access was an independent nav item in the Dev perspective, which is now one of the tabs in the Project Details page.

Solution Description
list & create access check has been added before rendering the Project Access tab. If the user has no permission to list or create project access, it will be hidden

GIF/Screenshot
pa-view
pa-edit

Screenshot from 2020-05-09 12-37-10

Unit test coverage report
test_pa

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 7, 2020
@openshift-ci-robot
Copy link
Contributor

@debsmita1: The label(s) kind/ cannot be applied, because the repository doesn't have them

In response to this:

Fixes
https://issues.redhat.com/browse/ODC-3733

Root Cause/Analysis
Previously Project Access was an independent nav item in the Dev perspective, which is now one of the tabs in the Project Details page.

Solution Description
An access check has been added before rendering the Project Access tab

GIF
pa-view
pa-edit

Unit test coverage report
test_pa

/kind bug

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the component/dev-console Related to dev-console label May 7, 2020
@debsmita1 debsmita1 changed the title Hide Project Access Tab when no permission Bug 1833146: Hide Project Access Tab when no permission May 7, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. label May 7, 2020
@openshift-ci-robot
Copy link
Contributor

@debsmita1: This pull request references Bugzilla bug 1833146, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1833146: Hide Project Access Tab when no permission

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 7, 2020
@debsmita1
Copy link
Contributor Author

/cc @andrewballantyne @openshift/team-devconsole-ux @serenamarie125

const canListRoleBindings = useAccessReview({
group: RoleBindingModel.apiGroup,
resource: RoleBindingModel.plural,
verb: 'list',
Copy link
Member

Choose a reason for hiding this comment

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

What will be the use case if the user has list permission but do not have create or delete permission?
In this case, can we show this page with all the form field in the read-only state?

see, this user has list access but not create and delete access.
Screenshot 2020-05-08 at 11 29 05 AM

cc: @serenamarie125 @christianvogt

Copy link
Contributor

Choose a reason for hiding this comment

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

@vikram-raj please raise an issue to track this. It's a general problem we need to get better at. We see the same missed experience for users with view but not edit access for health checks.

For simplicity right now it's best to stick to hiding if they cannot edit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@christianvogt, For now, do I need to hide the Project Access tab if the user has no permission to create & delete access?

Copy link
Contributor

Choose a reason for hiding this comment

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

We want to hide if the user cannot create role bindings.
There's other checks we should make but better to not let someone even attempt to do something they cannot complete right now.

Copy link
Member

@vikram-raj vikram-raj May 9, 2020

Choose a reason for hiding this comment

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

Yes, We need to check for both create and list access here.

Created an issue to track it https://issues.redhat.com/browse/ODC-3813
https://issues.redhat.com/browse/ODC-3819

@debsmita1 debsmita1 changed the title Bug 1833146: Hide Project Access Tab when no permission Bug 1833146: Hide Project Access Tab when the user have no access to role bindings May 8, 2020
Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

lgtm @debsmita1 ! thanks for doing this

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. and removed bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. labels May 9, 2020
@openshift-ci-robot
Copy link
Contributor

@debsmita1: This pull request references Bugzilla bug 1833146, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1833146: Hide Project Access Tab when the user have no access to role bindings

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@debsmita1
Copy link
Contributor Author

/retest

1 similar comment
@debsmita1
Copy link
Contributor Author

/retest

@debsmita1
Copy link
Contributor Author

/test frontend

Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2020
@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, debsmita1, serenamarie125, vikram-raj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2020
@openshift-merge-robot openshift-merge-robot merged commit 9f7e7a3 into openshift:master May 11, 2020
@openshift-ci-robot
Copy link
Contributor

@debsmita1: All pull requests linked via external trackers have merged: openshift/console#5350. Bugzilla bug 1833146 has been moved to the MODIFIED state.

In response to this:

Bug 1833146: Hide Project Access Tab when the user have no access to role bindings

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.5 milestone May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants