summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/middleware/gswauth/swauth/middleware.py
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2013-12-06 12:10:20 +0530
committerLuis Pabon <lpabon@redhat.com>2013-12-16 08:09:38 -0800
commite61f396cc79f013c0c0db0f521888c3bb878dd99 (patch)
tree19a2677e9a67bb91024a0931210a61e762336743 /gluster/swift/common/middleware/gswauth/swauth/middleware.py
parentcaeabbb85ecb8099df844b59af3cbfe37aa3091b (diff)
Fix typo and add comment
Fix spelling of "privileges" in gswauth-* commands. Add comment to clarify use of req.credentials_valid. Change-Id: Ibb4d331f57df29e28670252b1360b3a72ea688cf Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/6448 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster/swift/common/middleware/gswauth/swauth/middleware.py')
-rw-r--r--gluster/swift/common/middleware/gswauth/swauth/middleware.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/gluster/swift/common/middleware/gswauth/swauth/middleware.py b/gluster/swift/common/middleware/gswauth/swauth/middleware.py
index 648203e..ac1b295 100644
--- a/gluster/swift/common/middleware/gswauth/swauth/middleware.py
+++ b/gluster/swift/common/middleware/gswauth/swauth/middleware.py
@@ -1420,6 +1420,13 @@ class Swauth(object):
Returns True if the admin specified in the request represents a
.reseller_admin.
+ The variable req.credentials_valid is set to True if the credentials
+ match. This is used to distinguish between HTTPUnauthorized and
+ HTTPForbidden cases in denied_response method. HTTPUnauthorized is
+ returned when the credentials(username and key) do not match. A
+ HTTPForbidden is returned when the credentials match, but the user does
+ not have necessary permission to perform the requested action.
+
:param req: The swob.Request to check.
:param admin_detail: The previously retrieved dict from
:func:`get_admin_detail` or None for this function
@@ -1442,6 +1449,13 @@ class Swauth(object):
Returns True if the admin specified in the request represents a .admin
for the account specified.
+ The variable req.credentials_valid is set to True if the credentials
+ match. This is used to distinguish between HTTPUnauthorized and
+ HTTPForbidden cases in denied_response method. HTTPUnauthorized is
+ returned when the credentials(username and key) do not match. A
+ HTTPForbidden is returned when the credentials match, but the user does
+ not have necessary permission to perform the requested action.
+
:param req: The swob.Request to check.
:param account: The account to check for .admin against.
:param returns: True if .admin.