Fix indentation

This commit is contained in:
Shane Kilkelly 2017-10-19 14:54:59 +01:00
parent 5572a0e873
commit 97706acbac

View file

@ -37,21 +37,20 @@ module.exports = AuthorizationManager =
# Anonymous users can have read-only access to token-based projects,
# while read-write access must be logged in,
# unless the `enableAnonymousReadAndWriteSharing` setting is enabled
TokenAccessHandler.isValidToken project_id, token,
(err, isValidReadAndWrite, isValidReadOnly) ->
return callback(err) if err?
if isValidReadOnly
# Grant anonymous user read-only access
callback null, PrivilegeLevels.READ_ONLY, false
else if (
isValidReadAndWrite and
TokenAccessHandler.ANONYMOUS_READ_AND_WRITE_ENABLED
)
# Grant anonymous user read-and-write access
callback null, PrivilegeLevels.READ_AND_WRITE, false
else
# Deny anonymous access
callback null, PrivilegeLevels.NONE, false
TokenAccessHandler.isValidToken project_id, token, (err, isValidReadAndWrite, isValidReadOnly) ->
return callback(err) if err?
if isValidReadOnly
# Grant anonymous user read-only access
callback null, PrivilegeLevels.READ_ONLY, false
else if (
isValidReadAndWrite and
TokenAccessHandler.ANONYMOUS_READ_AND_WRITE_ENABLED
)
# Grant anonymous user read-and-write access
callback null, PrivilegeLevels.READ_AND_WRITE, false
else
# Deny anonymous access
callback null, PrivilegeLevels.NONE, false
else if publicAccessLevel == PublicAccessLevels.READ_ONLY
# Legacy public read-only access for anonymous user
callback null, PrivilegeLevels.READ_ONLY, true