added ownership and permission setting and overrides for unit testing