permission manager fix

Permission manager should work properly now. It is yet to be changed to
use datamapper instead of the 'old' way.