XFA
Well-known member
Hello,
So in one of the add-on I am developing, I have extended the class XF\Entity\Category to add a new function :
Whatever the permission value set globally or for the corresponding category, this function always return 0 when called from a template in the category_view page.
So I tried and did something similar for forum entity and called it on forum_view page, no more luck.
I did some digging/debug and tracked down in xF code where the issue could be.
My findings is that on those pages, the contentPerms array in XF\PermissionCache only contains the "view" permission index but that's all.
While it should in my opinion contain more than that. I tried digging further by couldn't figure out/
I am tending to think it might be a bug but wanted to see first if I am not doing something wrong, @Chris D or @Mike you might be the more accurate to answer.
Clément
So in one of the add-on I am developing, I have extended the class XF\Entity\Category to add a new function :
PHP:
public function canViewSeoExtension()
{
return \XF::visitor()->hasNodePermission($this->node_id, 'viewSeoExtension');
}
Whatever the permission value set globally or for the corresponding category, this function always return 0 when called from a template in the category_view page.
So I tried and did something similar for forum entity and called it on forum_view page, no more luck.
I did some digging/debug and tracked down in xF code where the issue could be.
My findings is that on those pages, the contentPerms array in XF\PermissionCache only contains the "view" permission index but that's all.
While it should in my opinion contain more than that. I tried digging further by couldn't figure out/
I am tending to think it might be a bug but wanted to see first if I am not doing something wrong, @Chris D or @Mike you might be the more accurate to answer.
Clément