kernel/classes/ezpolicy.php
function copy( $roleID )
    {
        $params = array();
        $params['ModuleName'] = $this->attribute( 'module_name' );
        $params['FunctionName'] = $this->attribute( 'function_name' );

        $db = eZDB::instance();
        $db->begin();
        $newPolicy = eZPolicy::createNew( $roleID, $params  );
        foreach ( $this->attribute( 'limitations' ) as $limitation )
        {
            $limitation->copy( $newPolicy->attribute( 'id' ) );
        }
        $db->commit();

        return $newPolicy;
    }
function copy( $roleID )
    {
        $params = array();
        $params['ModuleName'] = $this->attribute( 'module_name' );
        $params['FunctionName'] = $this->attribute( 'function_name' );

        $db = eZDB::instance();
        $db->begin();
        $newPolicy = eZPolicy::createNew( $roleID, $params  );
        foreach ( $this->attribute( 'limitations' ) as $limitation )
        {
            $limitation->copy( $newPolicy->attribute( 'id' ) );
        }
        $db->commit();

        return $newPolicy;
    }
function copy ( $ roleID ) { $ params = array ( ) ; $ params [ 'ModuleName' ] = $ this -> attribute ( 'module_name' ) ; $ params [ 'FunctionName' ] = $ this -> attribute ( 'function_name' ) ; $ db = eZDB :: instance ( ) ; $ db -> begin ( ) ; $ newPolicy = eZPolicy :: createNew ( $ roleID , $ params ) ; foreach ( $ this -> attribute ( 'limitations' ) as $ limitation ) { $ limitation -> copy ( $ newPolicy -> attribute ( 'id' ) ) ; } $ db -> commit ( ) ; return $ newPolicy ; }
Copies the policy and its limitations to another role

@param int $roleID the ID of the role to copy to
@return eZPolicy the created eZPolicy copy
Copies the policy and its limitations to another role