Changed permissions assignment, now via prefix

Added documentation and tests