Read only facade check #4003

Merged
merged 11 commits into from Feb 5, 2016

Conversation

Projects
None yet
3 participants
Owner

howbazaar commented Dec 20, 2015

When an environment user has only read access to the environment, the apiserver adds an extra method lookup filter.

The read only check has been kept quite separate from the user lookup as the read only code will also be used for model migrations.

apiserver/client_auth_root.go
+ // At this stage, any facade that is part of the restricted root
+ // (those that are accessable outside of environments) are OK
+ // because the user would have access to those facades if the went
+ // through the controller API endpoint rather than an environme
@mjs

mjs Dec 20, 2015

Contributor

sentence incomplete

+
+// isCallAllowableByReadOnlyUser returns whether or not the method on the facade
+// can be called by a read only user.
+func isCallAllowableByReadOnlyUser(facade, _ /*method*/ string) bool {
@mjs

mjs Dec 20, 2015

Contributor

This is ok but it might be clearer if you could specify entire facades (e.g. "foo.*" in the list of allowed read only methods used by isCallReadOnly.

Contributor

mjs commented Dec 20, 2015

LGTM!

Owner

howbazaar commented Feb 5, 2016

$$merge$$

Contributor

jujubot commented Feb 5, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Feb 5, 2016

Merge pull request #4003 from howbazaar/read-only-facade-check
Read only facade check

When an environment user has only read access to the environment, the apiserver adds an extra method lookup filter.

The read only check has been kept quite separate from the user lookup as the read only code will also be used for model migrations.

@jujubot jujubot merged commit 0296a83 into juju:master Feb 5, 2016

@howbazaar howbazaar deleted the howbazaar:read-only-facade-check branch Feb 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment