summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/middleware/gswauth/swauth/middleware.py
diff options
context:
space:
mode:
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.