限制 symfony admin 生成器中显示的选择编辑多选
我正在使用 sfGuardUser
模块的管理生成器。 generator.yml
文件的编辑部分如下所示:
edit:
title: Editing User "%%username%%"
display:
"User": [first_name, last_name, email_address, username, password, password_again]
"Permissions and groups": [is_active, groups_list, sites_list]
现在,并非每个用户都有权访问此表单,只有站点管理员允许站点管理员创建和更新自己的用户。 User
和 Site
之间存在多对多关系。每个站点管理员也是一个用户,因此具有一组关联的站点。
我希望 sites_list
不显示所有网站,而只显示与网站管理员关联的网站,从而确保网站管理员无法将自己的用户之一放入与管理员未关联的网站和。
在我看来,我需要用其他东西替换 sites_list
才能做到这一点,但我不知道在哪里以及如何进行此更改。
I am using the admin generator for the sfGuardUser
module. The edit portion of the generator.yml
file looks like this:
edit:
title: Editing User "%%username%%"
display:
"User": [first_name, last_name, email_address, username, password, password_again]
"Permissions and groups": [is_active, groups_list, sites_list]
Now, not every user will have access to this form, only site administrators allowing site administrators to create and update their own users. There is a many-to-many relation between User
and Site
. Each site administrator is also a user and as such has a set of associated sites.
I would like sites_list
to not show ALL sites, but rather, only the sites the site administrator is associated with thereby ensuring that a site administrator cannot put one of her own users into a site the administrator is not associated with.
It seems to me I need to replace sites_list
with something else to do this, but I do not know where and how to make this change.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为实现这一点的唯一方法是从自动生成的表单中更改sites_lists小部件。例如,就您而言,您可以执行以下操作:
The only way that I think to to this is by changing the sites_lists widget from the Autogenerated Form. In your case, for example, you could do something like: