Role permissions fix

Fixes to patch role permissions functionality