Skip to content

v2.0.3关闭缓存后删除操作 报《无删除条件》 #51

@i8u14

Description

@i8u14

topthink/framework v8.1.2 + topthink/think-orm v4.0.29 + casbin/casbin v4.0.5 + casbin/think-authz v2.0.3

当config/tauthz.php中 enforcers.basic.cache.enabled=false的时候
删除操作如 deleteRole、deletePermissionsForUser报错

执行到这里面

# 文件 vendor/casbin/think-authz/src/adapter/DatabaseAdapter.php
# line 232
 if ($this->cacheHandler->cachePolicies($model)->delete()) {
     ++$count;
}

# 文件 vendor/casbin/think-authz/src/cache/CacheHandler.php
# line 21 为false时
if ($this->config('cache.enabled', false)) { ... }

异常信息
#0 [10500]DbException in BaseQuery.php line 1442
没有条件不会执行删除操作

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions