Area Permissions
Permalink 1 user found helpful
Where do I find information about how to set area permissions programmatically?
I can set the page permissions already without a problem with:
Do I need the permissions object?
The big question is:
How do I create a page and only allow the owner to modify an area like 'Main',
BUT only allow adding of few block types?
I can set the page permissions already without a problem with:
$newPage = $parentPage->add($pt,$data); $permissionsConfig = new stdClass; $permissionsConfig->user[0]['uID'] = $u->getUserID(); $permissionsConfig->user[0]['canRead'] = 1; $permissionsConfig->user[0]['canWrite'] = 1; $permissionsConfig->user[0]['canApproveVersions'] = true; $permissionsConfig->user[0]['canDelete'] = false; $permissionsConfig->user[0]['canAdmin'] = false; $newPage->assignPermissionSet($permissionsConfig);
Do I need the permissions object?
$aa = Area::get($newPage, 'Main'); $pp = new Permissions($aa); $cap = array(1,2,3); $pp->addBlockTypes = $cap; //this line errors... $ps = $this->loadPermissionSet($pp);
The big question is:
How do I create a page and only allow the owner to modify an area like 'Main',
BUT only allow adding of few block types?
This is a good question and I am wondering this as well. Did you ever figure out how?
Hi Ideasponge,
This was related to Concrete v5.4 and by v5.6 the core team has changed the way it works since then. In v5.6 I used my page template to set permissions for the page and on the special areas to allow the "page owner" to edit. Be sure to use the permissions in the template to deny the ability to edit things like your primary nav and anything else you don't want them to change.
This was related to Concrete v5.4 and by v5.6 the core team has changed the way it works since then. In v5.6 I used my page template to set permissions for the page and on the special areas to allow the "page owner" to edit. Be sure to use the permissions in the template to deny the ability to edit things like your primary nav and anything else you don't want them to change.
Awesome thank you :)