Github user ustcweizhou commented on the pull request:

    https://github.com/apache/cloudstack/pull/1134#issuecomment-161537378
  
    LGTM. tested 
    (1) create affinity group in project
    (2) deploy vm with affinity group
    (3) update vm affinity group
    (4) delete affinity group.
    
    one suggestion,
    ```
    diff --git 
a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java 
b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
    index 5da1f88..e2de220 100644
    --- 
a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
    +++ 
b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java
    @@ -434,7 +434,7 @@ public class AffinityGroupServiceImpl extends 
ManagerBase implements AffinityGro
                     throw new InvalidParameterValueException("Unable to find 
affinity group by id " + affinityGroupId);
                 } else {
                     // verify permissions
    -                _accountMgr.checkAccess(caller, null, true, owner, ag);
    +                _accountMgr.checkAccess(caller, AccessType.OperateEntry, 
true, owner, ag);
                     // Root admin has access to both VM and AG by default, but 
make sure the
                     // owner of these entities is same
                     if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || 
_accountMgr.isRootAdmin(caller.getId())) {
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to