Permission denied to edit Permission Rules

Hi,

When I enter a custom doctype and I make changes to the Permission Rules table, I am faced with the following error when I try to save. I am currently logged in as the Administrator. Kindly assist how I could rectify this error. Thank you.

Traceback (most recent call last):
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 242, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 286, in _save
    self.run_post_save_methods()
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 728, in run_post_save_methods
    self.run_method("on_update")
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 661, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 839, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 822, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/model/document.py", line 655, in 
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 143, in on_update
    self.export_doc()
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 209, in export_doc
    export_to_files(record_list=[['DocType', self.name]])
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/modules/export_file.py", line 22, in export_to_files
    write_document_file(frappe.get_doc(record[0], record[1]), record_module, create_init=create_init)
  File "/home/frappe/benches/demo-erp/apps/frappe/frappe/modules/export_file.py", line 43, in write_document_file
    with open(os.path.join(folder, fname +".json"),'w+') as txtfile:
IOError: [Errno 13] Permission denied: u'/home/frappe/benches/demo-erp/apps/hr_custom/hr_custom/hr_custom/doctype/cpf_aw_ceiling/cpf_aw_ceiling.json'

Have you added a role to your custom doc type?(Set up> Doc type)

Hi @Pawan,

Yes, we do have a role currently in there. But what we are trying to achieve is to add another role (System Manager) and remove this one :

Hi @Pawan,

Would like to follow up on this Permission issue. Still unable to delete the role and add a new role, with the same issue highlighted above. We are in Developer mode. Is there any other permission that needs to be modified?

Thank you.

Are you seeing the delete button once you click on the below icon shown in the grid

Hi @Pawan,

Thank you, was able to do it - replaced the role I wanted to delete with HR Manager role. Not sure why but that is one role I was able to replace with, with no error.