incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/3] git commit: ApiServer: Fix debug output for role based user access checking
Date Mon, 07 Jan 2013 01:30:46 GMT
ApiServer: Fix debug output for role based user access checking

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/19cf6650
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/19cf6650
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/19cf6650

Branch: refs/heads/api_refactoring
Commit: 19cf665094f7915d8058cdb7c1cde8da870e9ab2
Parents: a9ab42d
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Sun Jan 6 16:51:14 2013 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Sun Jan 6 16:51:14 2013 -0800

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiServer.java |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/19cf6650/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index c9d4567..ca25d61 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -561,15 +561,15 @@ public class ApiServer implements HttpRequestHandler {
             if (userId != null) {
             	User user = ApiDBUtils.findUserById(userId);
                 if (!isCommandAvailable(user, commandName)) {
-                    s_logger.warn("The given command:" + commandName + " does not exist");
-                    throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given
command does not exist");
+                    s_logger.warn("The given command:" + commandName + " does not exist or
it is not available for user");
+                    throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given
command does not exist or it is not available for user");
                 }
                 return true;
             } else {
                 // check against every available command to see if the command exists or
not
                 if (!isCommandAvailable(null, commandName) && !commandName.equals("login")
&& !commandName.equals("logout")) {
-                    s_logger.warn("The given command:" + commandName + " does not exist");
-                    throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given
command does not exist");
+                    s_logger.warn("The given command:" + commandName + " does not exist or
it is not available for user");
+                    throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given
command does not exist or it is not available for user");
                 }
             }
 
@@ -662,8 +662,8 @@ public class ApiServer implements HttpRequestHandler {
             UserContext.updateContext(user.getId(), account, null);
 
             if (!isCommandAvailable(user, commandName)) {
-                s_logger.warn("The given command:" + commandName + " does not exist");
-                throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given
command:" + commandName + " does not exist");
+                s_logger.warn("The given command:" + commandName + " does not exist or it
is not available for user");
+                throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given
command:" + commandName + " does not exist or it is not available for user");
             }
 
             // verify secret key exists


Mime
View raw message