Completed updatePermission function

setPolicy now seems to work.
Maybe we can improve error handling when editing fails.
Improved error handling

If policy editing fails the previous view is restored
Merge pull request #2 from ccameroni/update-permissions

Update permissions