edited permissions function, created view