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

add login warning if cannot list or create projectrequests #12008

Conversation

juanvallejo
Copy link
Contributor

@juanvallejo juanvallejo commented Nov 23, 2016

Related PR: https://github.com/openshift/origin/pull/11904/files
Related Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1262696

This patch adds a check to see if the user cannot list projectrequests,
in addition to create projectrequests. This warning showed up previously
only when a user did not have a self-provisioner role, however, it
faield to show up if the user did have a self-provisioner role but
was unable to list projectrequests.

Before

$ oc login -u system:admin
# make sure auth users have ability to create projectrequests
$ oadm policy add-cluster-role-to-group self-provisioner system:authenticated:oauth
$ oc edit clusterrole basic-user
- apiGroups: null
  attributeRestrictions: null
  resources:
  - projectrequests
  verbs:
  - list # remove this verb (user will be able to create projectrequests, but not list them)  
$ oc login -u test -p test
Login successful.

You don't have any projects. You can try to create a new project, by running

    oc new-project <projectname>

After

$ oc login -u system:admin
# make sure auth users have ability to create projectrequests
$ oadm policy add-cluster-role-to-group self-provisioner system:authenticated:oauth
$ oc edit clusterrole basic-user
- apiGroups: null
  attributeRestrictions: null
  resources:
  - projectrequests
  verbs:
  - list # remove this verb (user will be able to create projectrequests, but not list them)  
$ oc login -u test -p test
Login successful.

You do not have access to create new projects, contact your system administrator to request a project.

cc @xiaocwan @fabianofranz

@fabianofranz
Copy link
Member

@openshift/cli-review @liggitt ptal

@fabianofranz
Copy link
Member

[test]

@juanvallejo juanvallejo force-pushed the jvallejo/warn-on-login-if-user-cannot-list-projects branch 2 times, most recently from 3aaa9e8 to a49a4f2 Compare November 28, 2016 19:01
@fabianofranz
Copy link
Member

Needs hack/update-generated-docs.sh. ;)

This patch adds a check to see if the user cannot list
`projectrequests`,
in addition to create `projectrequests`. This warning showed up
previously
only when a user did not have a `self-provisioner` role, however, it
faield to show up if the user did have a `self-provisioner` role but
was unable to list `projectrequests`.
@juanvallejo juanvallejo force-pushed the jvallejo/warn-on-login-if-user-cannot-list-projects branch from c848ffc to edf8423 Compare November 29, 2016 19:37
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to edf8423

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11784/) (Base Commit: 7ec2f67)

1 similar comment
@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11784/) (Base Commit: 7ec2f67)

@fabianofranz
Copy link
Member

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Nov 30, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11784/) (Image: devenv-rhel7_5446)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to edf8423

@openshift-bot openshift-bot merged commit 75fac72 into openshift:master Nov 30, 2016
@juanvallejo juanvallejo deleted the jvallejo/warn-on-login-if-user-cannot-list-projects branch November 30, 2016 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants