Fixed bug in permissions.