More general permissions module
Merge pull request #1 from Pajk/permissions

More general permissions module