CugTreePermission extends AbstractTreePermission implements CugConstants { @Override public boolean isGranted(long permissions) { return permissions == Permissions.READ_NODE && isAllow(); } CugTreePermission(@NotNull Tree tree, @NotNull TreeType type, @NotNull TreePermission parent,
                      @NotNull CugPermissionProvider permissionProvider);   CugTreePermission(@NotNull Tree tree, @NotNull TreeType type, @NotNull TreePermission parent,
                      @NotNull CugPermissionProvider permissionProvider, boolean inCug, boolean canRead, boolean hasNestedCug); @Override boolean canRead(); @Override boolean canRead(@NotNull PropertyState property); @Override boolean canReadAll(); @Override boolean canReadProperties(); @Override boolean isGranted(long permissions); @Override boolean isGranted(long permissions, @NotNull PropertyState property);  }
@Test public void testIsGranted() { assertFalse(allowedTp.isGranted(Permissions.ALL)); assertFalse(allowedTp.isGranted(Permissions.WRITE)); assertTrue(allowedTp.isGranted(Permissions.READ_NODE)); assertFalse(deniedTp.isGranted(Permissions.ALL)); assertFalse(deniedTp.isGranted(Permissions.WRITE)); assertFalse(deniedTp.isGranted(Permissions.READ_NODE)); }
@Test public void testIsGrantedProperty() { PropertyState ps = PropertyStates.createProperty("prop", "val"); assertFalse(allowedTp.isGranted(Permissions.ALL, ps)); assertFalse(allowedTp.isGranted(Permissions.WRITE, ps)); assertTrue(allowedTp.isGranted(Permissions.READ_PROPERTY, ps)); assertFalse(deniedTp.isGranted(Permissions.ALL, ps)); assertFalse(deniedTp.isGranted(Permissions.WRITE, ps)); assertFalse(deniedTp.isGranted(Permissions.READ_PROPERTY, ps)); }