This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » General » $node.can_create not working
expandshrink

$node.can_create not working

$node.can_create not working

Monday 11 March 2013 11:19:21 am - 3 replies

I have defined a role in which a certain class does not have the permission to create, but still when I login to the website with the specified user role. The property $node.can_create returns true, although the permissions to create are not given.

Any idea(s)?

Thanks for any help in advance.

Tuesday 12 March 2013 2:53:10 pm

See if you get a different result with view caching and template block cache turned on vs turned off. It's possible you've cached an old result and will need to adjust how the cache is being handled or the permission is being checked.

eZ Publish: It's Probably The Cache®

Friday 12 April 2013 11:38:42 pm

There is no cache activated for this project.

Monday 29 April 2013 12:28:12 pm

I solved it the following way
{def $classesInstantiate=fetch('content', 'can_instantiate_class_list')}

{if contains_classname($classesInstantiate, 'issue')}

create link mark up comes here

{/if}

My template operator looks like this
/**
 * @param $classes
 * @param $classname
 * @return bool
 */
private function containsClassName($classes, $classname)
{
    foreach($classes as $class) {
    if($class->attribute( 'identifier' ) === $classname)
        return true;
    }
    return false;
}

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from