简体   繁体   English

用户生成文件的权限管理

[英]Rights management for user generated files

I'm currently working on a Website, which should enable users to host files like pictures and documents. 我目前正在网站上工作,该网站应使用户能够托管图片和文档等文件。 I got a groups and user based Rightsmanagement in Place, but it does not quite fit this concept of groups and users. 我在适当的位置有一个基于组和用户的权限管理,但是它与组和用户的概念不太吻合。

For example: 例如:

A User uploads a file which should be collaborated on by a small group of 2-3 users. 用户上传的文件应由2-3个用户组成的小组进行协作。 This group is dynamic and they should only get access to this one File. 该组是动态的,他们应该只能访问该文件。 Another Group called Staff should be able to view it but not able to edit or delete it. 另一个名为“职员”的组应该可以查看它,但不能对其进行编辑或删除。

Another User, different from the First, also uploads the File, but only wants Staff to edit it and make it accessible to all users. 与第一名用户不同,另一个用户也上传了文件,但只希望Staff编辑它并使所有用户都可以访问它。

Effectively I would end up with many thousands of groups with many redundant rights. 实际上,我最终将拥有成千上万个具有许多冗余权限的组。 Is there any better approach to this? 有什么更好的办法吗?

Thanks 谢谢

It would be better if you more specify what sort of file you are talking about. 如果您进一步指定要谈论的文件类型,那会更好。 Isn't it better to keep content of file in database and grant right privileges for each user? 将文件内容保留在数据库中并为每个用户授予正确的权限不是更好吗? Or do you want physically file to be stored on machine? 还是您希望物理上将文件存储在计算机上?

I think you can use something like "group leader" - first registered user for specyfic group. 我认为您可以使用“组长”之类的东西-Specyfic组的第一个注册用户。 You can use his ID as Group ID (to reduce table count and avoid mess in table with groups without users). 您可以将其ID用作组ID(以减少表计数并避免在没有用户的情况下出现表混乱)。

If you want information about best approach - read about file rights management in Unix (standard or ACL, if you need multiple groups on user). 如果需要有关最佳方法的信息,请阅读Unix中的文件权限管理(如果需要在用户上有多个组,请使用标准或ACL)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM