Check if a user has write privileges
Permalink
As an admin, I would like to lock down all areas and blocks, except for a few. I think I understand how to do that.
My question is this: Inside of a custom block, How can I check to see if a user has 'edit' permissions for that block?
My question is this: Inside of a custom block, How can I check to see if a user has 'edit' permissions for that block?
How would you reapply permissions to that area if they need to be changed?
I'm creating a new page, setting the user as owner, and would like to set the permissions for the areas in it.
I'm also looking for a way to limit the block types the user can add.
lol, I just noticed this post was from 2008! Hope someone sees this...
$aa = Area::get($newPage, 'Main'); $pp = new Permissions($aa); $cap = array(1,2,3); $pp->addBlockTypes = $cap; //This won't work! //$ps = $this->loadPermissionSet($pp); //how do I change the permissions of an area??
I'm creating a new page, setting the user as owner, and would like to set the permissions for the areas in it.
I'm also looking for a way to limit the block types the user can add.
lol, I just noticed this post was from 2008! Hope someone sees this...
that's passing the object in question through the Permissions object, and operating on the object you get back.
In a block's template, you'd go:
$this->block automatically exists in the view template of a block. Try that and hopefully it should work.