相册照片隐私的亲子关系
我们如何最好地表示父子关系,其中子项有自己的设置,父项有自己的设置,但父项可以覆盖子项?
我的用例是相册的隐私级别。每个相册和每张照片都有一个隐私级别。因此,如果相册=自定义,则每张照片可以具有不同的隐私级别。但是,当然,如果相册设置为“仅限朋友”,则照片不能公开,因此任何公开的照片都会被覆盖为私人照片。或者,如果相册设置为“仅限网络”,则朋友可以看到它,但公众看不到。
我不确定这是通过应用程序逻辑还是通过模式处理。如果通过应用程序逻辑,那么我是否需要这些表中的“任何”列,还是 100% 应用程序端?
How do we best represent a parent child relationship where the child has its own settings, the parent has its own but the parent can overwrite the child?
My usecase is privacy level for photo album. Each album and each photo has a privacy level. So if album = custom then each photo can have different privacy level. But ofcourse if album is set to 'friends only' then the photos cannot be public, so any photo that is public is overwritten to private. Or if album is set to 'network only' then friends can see it but public cannot.
I am not sure if this is handled via application logic or through schema. If via application logic then do i need 'ANY' colunm in these tables for this or is it 100% application side?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以有一个权限层次结构,0 - 公共,1 - 网络,2 - 朋友,3 - 自己。相册和照片在数据库中都有一个权限字段,但照片的权限始终必须 >= 它们所在相册的权限。默认情况下,它们等于相册权限。
这样,您就可以拥有一个仅限网络的相册,其中包含一些仅限朋友的照片和一些仅限自己的照片。
因此,有关每个对象的权限的信息将存储在数据库中,但应用程序将控制可以为照片设置哪些权限,当然,根据对象的权限和用户可以控制谁可以查看哪些相册/照片。访客的状态/位置。
You could have a permissions hierarchy, 0 - public, 1 - network, 2 - friends, 3 - self. Both albums and photos would have a permissions field in the database, but the permissions for photos always have to be >= permissions for the album they're in. By default they'd be equal to album permissions.
This way you could have a network-only album with some friends-only and some self-only photos.
Thus, the information about permissions for each object would be stored in the database, but the application would control which permissions can be set for photos and, of course, who gets to see what album/photo based on the permissions of the object and the status/position of the visitor.
我认为这必须在应用程序中。这不是很多工作,基本上你检查相册是否有隐私级别,如果有,则将其应用于其子项,否则使用子项的隐私级别。这不是您在数据库中处理的那种事情。
I think this has to be in the application. It's not a lot of work, basically you check if the album has a privacy level, and if so apply that to its children, otherwise use the privacy level of the children. This isn't the sort of thing you'd handle in the db.