mirror of https://github.com/apache/cloudstack.git
bug 9991: do account permission check in getCloudIdentifier api
status 9991: resolved fixed
This commit is contained in:
parent
c663217b00
commit
630e8d9db4
|
|
@ -4094,12 +4094,16 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
@Override
|
||||
public ArrayList<String> getCloudIdentifierResponse(GetCloudIdentifierCmd cmd) {
|
||||
Long userId = cmd.getUserId();
|
||||
Account caller = UserContext.current().getCaller();
|
||||
|
||||
// verify that user exists
|
||||
User user = findUserById(userId);
|
||||
if ((user == null) || (user.getRemoved() != null)) {
|
||||
throw new InvalidParameterValueException("Unable to find active user by id " + userId);
|
||||
}
|
||||
|
||||
// check permissions
|
||||
_accountMgr.checkAccess(caller, _accountMgr.getAccount(user.getAccountId()));
|
||||
|
||||
String cloudIdentifier = _configDao.getValue("cloud.identifier");
|
||||
if (cloudIdentifier == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue