AndrewSimm
Well-known member
I have an addon that for some reason seems to only restrict access to Admins or Moderators despite setting permission for all user groups.
Here is a var_dump from guests that shows permissions to be true.
Here is my class extension
Here is my extended user entity
Here is the start of my controller
Here is a var_dump from guests that shows permissions to be true.
Here is my class extension
Here is my extended user entity
<?php
namespace Andrew\BannedUsersList\XF\Entity;
class User extends XFCP_User
{
public function canViewBannedUsersList(&$error = null)
{
$visitor = \XF::visitor();
return ($visitor->hasPermission('andrew_banneduserslist', 'canViewBannedUsersList'));
}
public function canViewBannedBy(&$error = null)
{
$visitor = \XF::visitor();
return ($visitor->hasPermission('andrew_banneduserslist', 'canViewBannedBy'));
}
}
Here is the start of my controller
public function actionIndex()
{
$visitor = \XF::visitor();
if(!$visitor->canViewBannedUsersList())
{
return $this->noPermission();
}
blah blah blah