I’m having a problem with the permissions applied to a PHP page
Users and permissions are static and for each permission there is one or more associated users, but now I can’t figure out what’s going on.
If after creating a new PHP page, I protect it with Security Provider Enforcer, and configure “ANY” for all permission levels, the page is displayed, but if instead I choose a protection with only one permission, the page gives an error
Also note that to enter the names of the pages “login.php” and “index.html” I had to do it manually because the system is unable to select them with the search in the folder
{"code":0,"file":"D:\\home\\.....\\....\\dmxConnectLib\\lib\\auth\\StaticProvider.php","line":30,"message":"Undefined property: lib\\auth\\StaticProvider::$permissions","trace":"#0 D:\\home\\.....\\....\\dmxConnectLib\\lib\\auth\\StaticProvider.php(30): exception_error_handler()\n#1 D:\\home\\.....\\....\\dmxConnectLib\\lib\\auth\\Provider.php(178): lib\\auth\\StaticProvider->permissions()\n#2 D:\\home\\.....\\....\\dmxConnectLib\\modules\\auth.php(74): lib\\auth\\Provider->restrict()\n#3 D:\\home\\.....\\....\\dmxConnectLib\\lib\\App.php(204): modules\\auth->restrict()\n#4 D:\\home\\.....\\....\\dmxConnectLib\\lib\\App.php(176): lib\\App->execSteps()\n#5 D:\\home\\.....\\....\\dmxConnectLib\\lib\\App.php(144): lib\\App->execSteps()\n#6 D:\\home\\.....\\....\\test.php(19): lib\\App->exec()\n#7 {main}"}
I think there are too many errors
I do not understand
I specify that the path addresses are hidden but they are all correct
\…\…\
It is only a single error, the error message is Undefined property: lib\\auth\\StaticProvider::$permissions
. It shows so many data because it includes the stack trace, it shows all the functions that were called before the error.
There is a PHP code block inserted on your page, can you post that code. The error message says that the permissions property is not set, could be that the code block didn’t generate correctly or there is a bug in the plugin code.
Could you edit the StaticProvider.php file at line 30, change it to:
if (!in_array($identity, $this->perms->$permission)) {
Thanks Patrick
Now the pages no longer give errors
Fixed in Wappler 5.6.2