Programmatically set page permission setting

How can I set the permission setting of a page programmatically to “by pagetype”
image
This works to create the page:

$projectpage = $userpage->add($pageType, array(
    'cName' => 'Projekt',
    'cDescription' => 'Hierher Beschreibung',
    'cHandle ' => 'projekt'
), $template);
$projectpage->update(array(
    'uID' => $user->getUserID() // updates the author ID on the page
));

$projectpage->inheritPermissionsFromDefaults()

https://documentation.concretecms.org/api/9.0.1/Concrete/Core/Page/Page.html#method_inheritPermissionsFromDefaults

1 Like