Create role using php

Author Message

Tamaki Hodge

Sunday 01 October 2006 8:52:00 pm

Hi,

Does anyone know how to create a role programmatically using php?

Thanks.

Ɓukasz Serwatka

Sunday 01 October 2006 11:27:03 pm

Hi Tamaki,

Take a look on kernel/classes/ezrole.php class definition.

$role = eZRole::create( 'Role name' );
$role->store();

Related classes are also:
kernel/classes/ezpolicy.php
kernel/classes/ezpolicylimitation.php

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Tamaki Hodge

Monday 02 October 2006 3:23:03 pm

Thanks Lukasz,

I managed to get something going.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.