Skip to content

Commit

Permalink
Merge a fix for a bug in VmInstances.java in if condition when checki…
Browse files Browse the repository at this point in the history
…ng the VM permission.
  • Loading branch information
wenye committed Feb 12, 2010
1 parent c32917a commit 15b426e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -136,7 +136,7 @@ public VmInstance lookupByPublicIp ( String ip ) throws NoSuchElementException {

public static VmInstance restrictedLookup( String userId, boolean administrator, String instanceId ) throws EucalyptusCloudException {
VmInstance vm = VmInstances.getInstance( ).lookup( instanceId ); //TODO: test should throw error.
if ( !administrator || !vm.getOwnerId( ).equals( userId ) ) {
if ( !administrator && !vm.getOwnerId( ).equals( userId ) ) {
throw new EucalyptusCloudException( "Permission denied while trying to lookup vm instance: " + instanceId );
}
return vm;
Expand Down

0 comments on commit 15b426e

Please sign in to comment.