Closed rus-ik closed 2 years ago
@basakest
I tried to use the corresponding version of the composer package to reproduce this error, but I got another error, the error message is as follows: Class Lauthz\Adapters\DatabaseAdapter contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Casbin\Persist\UpdatableAdapter::updatePolicies). Can you provide some other information?
@techoner
Any ETA of the bugfix, guys?
hey guys, the problem is that .. the minimal workable version of laravel-authz (it seems it was v1.4 or 1.5, which worked fine w/o the error mentioned above) is not working with the latest laravel v8.. and since we've moved forward to v8 we cannot downgrade to make everything work fine again like it was..
So can you please either catchup in v1.5 to laravel v8 or to fix the bug in the latest version.. Thanks in advance!
@basakest plz support Laravel 8
It seems it's a tricky bug:
here is my model.conf:
[request_definition] r = sub, obj, act
[policy_definition] p = sub, obj, act
[roledefinition] g = , _
[policy_effect] e = some(where (p.eft == allow))
[matchers] m = g(r.sub, p.sub) && keyMatch2(r.obj, p.obj) && regexMatch(r.act, p.act)
I'm sorry, but I still haven't been able to reproduce this error
@rus-ik can you provide a fully reproducible code repo?
Sorry guys, it turned out that we had overloaded casbin classes (mainly to suppress the not controlled logging) and after the right upgrade everything works fine. Thank you for your time and attention!
But nonetheless, it'd be great to have any feature for the logging switching in the places like this one: https://github.com/php-casbin/php-casbin/blob/master/src/CoreEnforcer.php#L365
And to have a short, one-line logging like this one, out of the box: ... [2021-08-08 11:00:10] prod.INFO: DENIED 212.118.111.222 - o.ivanov@mail.ru "GET" "/api/v1/role1/users" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" ...
/**
@author techlee@qq.com */ class DefaultLogger implements Logger { const LOG_CHANNEL = 'stdout'; const LOG_IDENTIFIER = 0; const LOG_ROUTE = 1; const LOG_METHOD = 2; const LOG_BROWSER = 3; const LOG_IP = 4; const LOG_RESULT = 5; ... /**
/**
@rus-ik can you make a PR?
I will, but .. not now..
Starting from v2.2.0 I'm getting the following error while executing Enforcer::deleteRoleForUser
Call to undefined method Casbin\Enforcer::buildIncrementalRoleLinks()\n#0 /var/www/html/vendor/casbin/casbin/src/ManagementEnforcer.php(582): Casbin\InternalEnforcer->removePolicyInternal()\n#1 /var/www/html/vendor/casbin/casbin/src/ManagementEnforcer.php(540): Casbin\ManagementEnforcer->removeNamedGroupingPolicy()\n#2 /var/www/html/vendor/casbin/casbin/src/Enforcer.php(100): Casbin\ManagementEnforcer->removeGroupingPolicy()\n#3 /var/www/html/app/Observers/Auth/UserAccessGroupObserver.php(65): Casbin\Enforcer->deleteRoleForUser()\n#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(412): ... casbin/casbin version is v3.6.0
If it's difficult to implement, then it seems "require" in composer.json is not quite correct..
"require" : { "casbin/casbin": "~3.1", ... }