Skip to content

Commit

Permalink
Merge pull request #7 from Ur-Solutions/fix/docs-typo
Browse files Browse the repository at this point in the history
fix(docs): typo in function calls
  • Loading branch information
tOgg1 committed Jan 27, 2021
2 parents 9fd08e2 + a6f7fd7 commit 04f7107
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/guide/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ and :code:`scopes_grant_permissions` methods.
# First argument is required scopes, second is granting scopes. Note that the method
# returns true if _any_ matches. Also note that any excluding permission takes precedence.
scopes_grants_permissions(["scope1:scope2"], ["scope1"]) # True
scopes_grants_permissions(["scope1:scope2"], ["=scope1", "scope1"]) # True
scopes_grants_permissions(["scope1:scope2"], ["-scope1", "scope1:scope2"]) # False
scopes_grant_permissions(["scope1:scope2"], ["scope1"]) # True
scopes_grant_permissions(["scope1:scope2"], ["=scope1", "scope1"]) # True
scopes_grant_permissions(["scope1:scope2"], ["-scope1", "scope1:scope2"]) # False
These methods also accepts a third argument for the required `verb`.

Expand All @@ -37,10 +37,10 @@ These methods also accepts a third argument for the required `verb`.
scope_grants_permission("scope1:scope2", "scope1:scope2:read", "read") # True
scope_grants_permission("scope1:scope2", "scope1:scope2:update", "read") # False
scopes_grants_permissions(["scope1:scope2"], ["scope1", "scope1:read"], "read") # True
scopes_grants_permissions(["scope1:read", "scope3:update"], ["scope3", "=scope1:read"], "read") # True
scopes_grant_permissions(["scope1:scope2"], ["scope1", "scope1:read"], "read") # True
scopes_grant_permissions(["scope1:read", "scope3:update"], ["scope3", "=scope1:read"], "read") # True
# Note here that since we have a direct exclude on scope3:update, the request is disallowed.
scopes_grants_permissions(["scope1:read", "scope3:update"], ["-scope3:update", "=scope1:read"], "read") # False
scopes_grant_permissions(["scope1:read", "scope3:update"], ["-scope3:update", "=scope1:read"], "read") # False
Under the hood, these methods use the :code:`scope_matches` method, which simply makes a required scope with a granting scope.
Expand Down

0 comments on commit 04f7107

Please sign in to comment.