mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ApiServer: Fix debug output for role based user access checking
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
a9ab42d962
commit
19cf665094
@ -561,15 +561,15 @@ public class ApiServer implements HttpRequestHandler {
|
|||||||
if (userId != null) {
|
if (userId != null) {
|
||||||
User user = ApiDBUtils.findUserById(userId);
|
User user = ApiDBUtils.findUserById(userId);
|
||||||
if (!isCommandAvailable(user, commandName)) {
|
if (!isCommandAvailable(user, commandName)) {
|
||||||
s_logger.warn("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 does not exist");
|
throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "The given command does not exist or it is not available for user");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// check against every available command to see if the command exists or not
|
// check against every available command to see if the command exists or not
|
||||||
if (!isCommandAvailable(null, commandName) && !commandName.equals("login") && !commandName.equals("logout")) {
|
if (!isCommandAvailable(null, commandName) && !commandName.equals("login") && !commandName.equals("logout")) {
|
||||||
s_logger.warn("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 does not exist");
|
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);
|
UserContext.updateContext(user.getId(), account, null);
|
||||||
|
|
||||||
if (!isCommandAvailable(user, commandName)) {
|
if (!isCommandAvailable(user, commandName)) {
|
||||||
s_logger.warn("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");
|
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
|
// verify secret key exists
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user