我正在使用sfDoctrineGuard 5.x,我在security.yml中配置了我的模块凭据,如下所示:
all:
is_secure: true
credentials: [ admin ]
和我的app / backend / config / security.yml:
default:
is_secure: true
我已经测试过:
$this->getUser()->hasPermission('vendor')
:返回true
$this->getUser()->hasPermission('admin')
:返回false
所以我猜用户正在继承凭证。但是仍然拥有其他凭据的用户可以访问该模块!
我有3种类型的组管理员,客户端和供应商以及类似的权限:管理员,客户端和供应商!
具有“客户端”或“供应商”凭据的用户可以在登录后忽略security.yml中定义的凭据访问该模块!
可能是什么问题?谁能给我一些方向?
哦,我正在使用sfForkedApplyPlugin进行注册和配置文件编辑过程,我认为这不会导致问题,因为我正在测试预定义的灯具数据。
答案 0 :(得分:1)
我刚才发现了问题! 这是 * sf_guard_user * 表中的 * is_super_admin * 字段,对于fixture.yml :)中的所有虚拟用户,该字段设置为1! 这就是为什么每个用户都可以绕过凭证访问所有模块!