bug fixes

1) Simple typo of variable name.
2) Permissions was assuming all resources were of type UserGroup.
Changed it to call super when this wasn't the case.  Also some documents
were coming in as RDF docs and some were coming in as dicts.  I added a
check to convert dicts to RDF docs.  Perhaps this isn't correct though
as it's due to a bug somewhere else?