Forums / Setup & design / Create role using php

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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.