Fixing duplicatas and database.
Merge pull request #418 from ngodfraind/default-resource-perms

Fixing duplicatas and database.