Kentico 8-页面访问:拒绝除角色以外的所有用户 [英] Kentico 8 - page access: deny for all users except a role

查看:61
本文介绍了Kentico 8-页面访问:拒绝除角色以外的所有用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在想要做的是仅允许具有特定角色的用户访问页面(及其子页面).这就是我现在得到的:

What I'm trying to do now is to let only users of a specific role to access a page (and its child pages). this is what I got at the moment:

用户

用户A-> RoleA,RoleB的成员

User A -> Member of RoleA, RoleB

用户B-> RoleB的成员.

User B -> Member of RoleB.

内容树

  • MainNode

  • MainNode

  • 要保护的页面

  • PAGE TO SECURE

其他需要公开的页面.

要保护网页"权限

  • 添加了角色A",并在完全控制"上选中了允许". 必需的身份验证"设置为是".

期望结果

仅当用户是角色A的一部分时,才可以访问确保安全的页面".事实也是其他角色的一部分.

"PAGE TO SECURE" accessible only if a user is part of Role A REGARDLESS the fact is part of other roles too.

我应该怎么做

  • 如果用户通过了身份验证,则无论角色如何,都可以看到要保护的页面".

我尝试的内容

  • 在页面上将所有其他角色的权限添加为拒绝".由于拒绝"的优先级高于允许"的权限,因此尽管用户A也具有正确的角色,但仍然不允许其查看该页面.

  • add on permission on the page for all other roles to "Deny". since "Deny" has priority over "Allow", User A is still not allowed to see the page despite the fact that got the right role too.

遵循了有关该线程的建议 http://devnet.kentico .com/forums?forumid = 54& threadid = 23234 (适用于kentico 5,但这是我到目前为止发现的唯一关于此问题的线程),以添加另一个节点并将其设置为页面的父节点安全,然后将所有拒绝设置为该新的父节点,然后中断继承并仅允许角色A.由于用户B仍然能够访问该页面,因此该操作无效.

followed the advice on this thread http://devnet.kentico.com/forums?forumid=54&threadid=23234 (is for kentico 5 but is the only thread i've found so far about this issue) to add another node and set that as a parent of the page to secure, then set deny all to this new parent node and then break inheritance and allow only the role A. this didn't work as user B is still able to access the page.

以上文章讨论了如何创建自定义Web部件.我宁愿不对这种基本功能使用这种方法.希望有另一种方法可以实现这一目标.

the above article talks about creating a custom web part. I prefer not to use this approach for such a basic feature. hope there's another way to achieve this.

推荐答案

您无法通过权限执行此操作,因为权限"Deny"的等级高于允许"的等级.因此,当用户处于角色A和B(其中A具有允许和B拒绝)时,拒绝被阻止. 唯一的方法是创建自己的Web部件,它将对此进行管理.

You can't do it by permissions, beacuse the permission "Deny" has higher rank than "Allow". So when the user is in the role A and B which A has Allow and B Deny, the Deny is blocking. The only approach for this is to create your own web part, that will manage this.

这篇关于Kentico 8-页面访问:拒绝除角色以外的所有用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆