设计工作空间 - 会话范围最好?
Grails 新手 - 我正在构建一个简单的 Grails 应用程序,用户将在顶级域对象(“工作区”)范围内处理域层次结构中的对象。例如,如果我的域对象是项目作者(1-M)和作者评论(1-M),我只希望当前所选项目的作者和评论对用户可见(他们可以切换项目/但工作区)。
从设计原则来看,存储当前“工作场所”的索引最好在会话范围内完成,还是作为持久的“用户首选项”对象?这需要对控制器进行大量的返工,所以我对是否走这条路犹豫不决。
安全性可能会成为一个问题,因此我犹豫是否要参数化每个“工作区”的所有 URL。
任何建议将不胜感激。
Grails newbie - I'm building a simple Grails app where a user will be working on objects down the domain hierarchy within the scope of a top-level domain object - the "workspace". For example, if my domain objects are project-author (1-M) and author-comments (1-M), I only want the authors and comments for the currently selected project to be visible to the user (they can switch projects/workspaces though).
From a design principle, is storing the index of the current "workplace" best done in session scope, or as a persisted "user preferences" object? This would require quite a bit of rework on the controllers, so I'm hesitant to go down this route.
Security may become an issue, so I'm hesitant to parameterize all my URLs for each "workspace".
Any advice would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,目前有两种方法可以使用现有插件来处理此问题:
Basically there are currently two ways to deal with this by using existing plugins: