issue #435: Fix resource authorization logic

The current logic is broken. Therefore, some cases which
should allow a user to have access to a VM may fail.
For example, if one VM has only group permission but no user permission,
users who are members of the allowed groups are not able to access
that VM. Other cases may behave wrong as well.

Change the authorization logic so it works in all cases.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>