【发布时间】:2017-08-02 02:55:36
【问题描述】:
我们在 Silverstripe 项目中的 Member 类上有一个自定义扩展:
public function canView($member = null) {
if ($this->Link() && $this->isPublished()) {
return true;
} else {
return false;
}
}
因此,只有通过$this->isPublished() == true 专门发布的会员详细信息才能查看。
此方法一直运行良好,但最近升级到 Silverstripe 3.6.1 似乎破坏了它。 CMS 管理员不能再创建新成员(返回 403/Forbidden 错误),除非 canView 被覆盖为“true”:
public function canView($member = null) {
return true;
}
我该如何设置它:
- 在公共网站上,只有在以下情况下才能查看会员详细信息
$this->isPublished() == true - 在 CMS 中,用户可以通过以下方式查看所有成员详细信息 管理员权限。
提前谢谢你。
【问题讨论】:
标签: php silverstripe