delete debug stuff
fixed setRestrictedResource when updating

and added more tests for the new helper method