I'd like to create an "Editor" user role, similar to the one used in WordPress. I gather from looking at the core, I could do something like this:
// Editors have the same priveleges as Contributors but can edit – but not delete – records created by other users.
$acl->allow('editor', 'Items', array('add', 'tag', 'batch-edit', 'batch-edit-save',
'change-type', 'delete-confirm', 'edit',
'deleteSelf', 'showSelfNotPublic'));
$acl->allow('editor', 'Files', 'edit');
$acl->allow('editor', 'Tags', array('autocomplete'));
$acl->allow('editor','Collections', array('add', 'delete-confirm', 'edit',
'deleteSelf', 'showSelfNotPublic'));
$acl->allow('editor', 'Elements', 'element-form');
The question is really about how to do so via a plugin. What classes/filters/hooks/tables am I dealing with? Can anyone point me to some useful existing code?
Incidentally, I think this should probably be a default role. The gap between contributor and admin seems a bit large. Something in between might be broadly useful.