I need an action which creates a new role with default permissions and a customized name as well as an action to delete a role to make Rules like the following:
- When a new node of content type "company" is created, create a new role with name "role_companyname"
- When a new node of content type "department" is created, populate the referenced company node and create a new role with name "role_companyname_departmentname"
- When a node of content type "department" is created, delete the role with name "role_departmentname"
- etc.
Question:
1) Where can I add custom code to make custom actions available?
2) What code do I need to a) create new roles, b) delete existing roles?