简体   繁体   English

在EWL中,可通过多个角色访问的实体上的父页面/面包屑的最佳实践是什么?

[英]In EWL, what's the best practice for parent-page/breadcrumbs on an entity accessible by multiple roles?

Let's say I have a screen that lets the user edit a person's general information, and this screen can be access by either the person themselves or by administrators. 假设我有一个屏幕,用户可以通过该屏幕编辑人员的一般信息,该人员自己或管理员都可以访问此屏幕。 The administrators will be coming from a parent list of people, and ideally that would be defined as the parent for this entity. 管理员将来自上级人员列表,理想情况下,将其定义为该实体的上级人员。 The person, though, has no access above this level. 但是,此人无法访问此级别以上的权限。

I usually return null unconditionally in these situations, and provide nav links for admins to get back up, if necessary. 在这种情况下,我通常无条件返回null,并在必要时为管理员提供导航链接。 I'm also considering having the parent be conditional, and return the parent list only if the user is an admin. 我还考虑让父对象成为条件对象,并且仅当用户是管理员时才返回父列表。 What's the best practice here? 这里的最佳做法是什么?

partial class Info {
  protected override PageInfo createParentPageInfo() {
    var conditionalParent = MyParentPage.GetInfo();
    return conditionalParent.UserCanAccessPageAndAllControls ? conditionalParent : null;
  }

  protected override ConnectionSecurity ConnectionSecurity { get { return ConnectionSecurity.SecureIfPossible; } }
}

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

相关问题 实体框架中多个“包含”的最佳实践是什么? - What is the best practice for multiple “Include”-s in Entity Framework? 什么是最佳做法? 属性还是实体? - what is best practice? An attribute or an Entity? 关于在用户控件和父页面之间进行通信的最佳实践是什么? - What is best practice with regards to communicating between a user control and parent page? 最佳实践-处理多个字段,用户角色和一个存储过程 - Best Practice - Handling multiple fields, user roles, and one stored procedure 在实体框架中更新记录的最佳做法是什么? - what is the best practice to update a record in entity framework? EWL中的initUserDefaultOptionalParameterPackage有什么用? - What use is initUserDefaultOptionalParameterPackage in EWL? 最佳实践:将多个实体转换为单个实体 - Best practice: multiple entities to single entity 在创建时将多个文件附加到实体的最佳方法是什么? - What's the best way to attach multiple files to a entity on creation? 在Linq for Entity Framework中,通过查询多列搜索字符串来返回结果集的最佳实践是什么? - In Linq for Entity Framework, what is the best practice for returning a resultset by querying multiple columns for a search string? 添加具有多个实体的实体的最佳实践(实体框架) - Best Practice for Adding an Entity with Multiple Subentities (Entity Framework)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM