// add view permissions for all users
Principal p = new Principal("users", Principal.Type.EVERYBODY);
ActionDTO view = new ActionDTO(new ViewAction());
perms.getPermissions().add(new Permission(
p, view, Permission.Access.GRANT));
ActionDTO modify = new ActionDTO(new ModifyAction());
perms.getPermissions().add(new Permission(
p, modify, Permission.Access.DENY));
state.setPermissions(perms);
return (T) state;