Drupal权限,用户案例
该网站的目标是维护产品
列表。
- 每个
产品
由标题、描述和数量(CCK字段)组成。 - 每个
产品
都属于一个商店
。 - 每个
商店
都有一个经理
。 - 所有
产品
对所有人可见。 经理
只能添加/编辑自己商店
的产品
。- 站点
管理员
可以创建新的商店
和新的经理
。
对于上述场景,如何设置权限呢?
我正在考虑使用 Taxonomy
作为商店名称,使用 Taxonomy Access Control 进行权限控制。但不确定我是否走在正确的道路上...
此外,有机群组也是一种选择吗?
谢谢!
The objective of the site is to maintain a product
listing.
- Each
product
composes of a title, description and quantity (CCK field). - Each
product
belongs to ashop
. - Each
shop
has amanager
. - All
products
are visible to all. - A
manager
can only add/editproducts
of his ownshop
. - A site
admin
can create newshops
and newmanagers
.
How can I set the permission for the above scenario?
I am thinking of using Taxonomy
for shop names, Taxonomy Access Control for permission control. Not sure whether I am on the right track though...
Besides, is Organic Groups also an option?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TAC 解决您的问题。我在非常相似的场景中使用它。设置方法如下:
只要您对内容类型的权限设置为允许匿名用户查看“产品”中的字段,就应该可以做到这一点。
TAC solves your problems. I'm using it in a very similar scenario. Here's how to set it up:
That should do it, as long as your permissions for the content type are set up to allow anonymous users to view the fields in "Product".
我认为您使用分类访问控制的方法可能可行,但是将用户分配给分类以获得适当的权限将需要一些自定义代码。
使用有机组可能会提供更强大的开箱即用访问(每个商店都是一个组,然后在该组中发布产品),但您需要将许多默认设置主题化以隐藏论坛/墙 - OG 开箱即用的新闻工作流程(这可以通过 OG 提供的钩子来完成)。
这样做的优点是,要将产品经理添加到商店,您只需将他们设置为组管理员(通过这种方式,商店可以有多个管理员)。您可以将每个组设置为公共(以便所有产品都可见),但只向该组的管理员授予编辑组中节点的权限。组管理员也是唯一有权创建产品节点的人,这些节点将被设置为组节点(这是在节点类型编辑屏幕或 OG 管理屏幕上完成的)。
I think your approach with Taxonomy Access Control may be work, but assigning users to a taxonomy for the proper permissions would require a bit of custom code.
Using Organic Groups might provide more robust access out of the box (each shop is a group, and products are then published in that group), but you would need to theme a lot of the defaults away in order to hide the forum/wall-of-news workflow that OG comes with out of the box (this can be done with the hooks OG provides).
The advantage here is that to add product managers to a shop, you would simply make them the group administrator (a shop could have more than one admin this way). You would set each group as public (so all products are visible), but only grant permission to edit nodes in the group to the admin of that group. Group admins would also be the only ones with permission to create product nodes, which would be setup as group nodes (this is done at the node-type edit screen, or at the OG admin screen).