mirror of https://github.com/apache/cloudstack.git
Adding Operate access check at service layer, since we are not checking access on the command parameter here
This commit is contained in:
parent
e5d722654a
commit
a837ac8873
|
|
@ -19,8 +19,6 @@ package org.apache.cloudstack.api.command.user.securitygroup;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.acl.IAMEntityType;
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiCommandJobType;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
|
|
@ -47,7 +45,6 @@ public class RevokeSecurityGroupEgressCmd extends BaseAsyncCmd {
|
|||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@ACL(accessType = AccessType.OperateEntry, pointerToEntity = "securityGroupId")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, required = true, description = "The ID of the egress rule", entityType=SecurityGroupRuleResponse.class)
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import javax.naming.ConfigurationException;
|
|||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupEgressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.AuthorizeSecurityGroupIngressCmd;
|
||||
import org.apache.cloudstack.api.command.user.securitygroup.CreateSecurityGroupCmd;
|
||||
|
|
@ -812,7 +813,7 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
|
|||
|
||||
// Check permissions
|
||||
SecurityGroup securityGroup = _securityGroupDao.findById(rule.getSecurityGroupId());
|
||||
_accountMgr.checkAccess(caller, null, true, securityGroup);
|
||||
_accountMgr.checkAccess(caller, AccessType.OperateEntry, true, securityGroup);
|
||||
|
||||
return Transaction.execute(new TransactionCallback<Boolean>() {
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue