Fix inifinite redirection when trying to remove something while logged in but without the right permissions.

When you tried to remove a map, a layer, or a document, logged in but without the permissions to do it, it got you into an infinite redirection. 
Catching the PermissionDenied exception sent by resolve_object fixes that.
We should also modify the templates so that when you have read/write permissions, but not manage permissions, it doesn't show the remove and change permissions buttons.
To do that, maybe we could check the role of the user instead of checking his permissions one by one since the buttons remove and change permissions should appears only if the user has admin right on the object.