Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
.请指导我,我的控制器中有两种方法,一种是登录,第二种是注销。在我的数据库中定义了 1 个角色“用户”,我有一个具有该角色的用户。现在我想做的是那个人可以登录但无法访问注销按钮。我如何添加允许该用户不注销的权限/限制。
看看您的其他问题(http://stackoverflow.com/questions/5815401/how-to-implement-shiro-security-of-grails-in-my-project)并roleUser.addToPermissions('auth:login,signIn')作为许可使用。这会添加您的问题中描述的权限:只允许登录,注销不在列表中,因此不允许。我们不仅要说明login哪个会显示登录屏幕,还要signIn说明哪个是实际登录的动作。
roleUser.addToPermissions('auth:login,signIn')
login
signIn