Skip to content

If user does not have permission for the resource, the action should be not shown. #4370

@shu-mutou

Description

@shu-mutou

Environment

Installation method: minikube v1.4.0 and development container for dashboard
Kubernetes version: 1.16.0
Dashboard version: master
Operating system: Ubuntu 18.04 LTS
Node.js version ('node --version' output): 11.15.0
Go version ('go version' output): 1.12.6
Steps to reproduce

Add kubernetes-dashboard resources into minikube.

  1. Deploy dashboard and resources needed with running kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml into minikube.
  2. Attach cluster-admin ClusterRole with kubernetes-dashboard ServiceAccount in new ClusterRoleBinding labeled k8s-app: kubernetes-dashboard.
  3. Edit type as NodePort in dashboard-metrics-scraper of Service

Run dashboard.

  1. Run dashboard using development container according to Getting started.

Show dashboard in browser.

  1. Get token for kubernetes-dashboard ServiceAccount.
  2. Log in with the token above.
  3. Show secret list.
  4. Right click kubernetes-dashboard-certs or kubernetes-dashboard-key-holder.
Observed result

They have Edit menu, but it could not get its YAML in edit view.
And got 401 error in browser console.

Expected result

If user does not have permission for the resource, it's better to hide Edit menu.

Comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions