Adding and "Editor" user role

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.

A plugin can make these changes with just the define_acl hook.

Plugins generally add resources with that hook, but you can add a role and set up its permissions also.

For anyone who might be interested, I've created a plugin that adds two new roles: AUTHOR and EDITOR. Both are derived from the Contributor role, but Authors have the additional ability to make their own items public/featured, and Editors have the additional ability to edit/delete items created by other users.

See: MoreUserRoles plugin on Github.