Implemented permissions and fixed roles.