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

52 views Asked by At

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. 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?

1

There are 1 answers

0
William Gross On BEST ANSWER
partial class Info {
  protected override PageInfo createParentPageInfo() {
    var conditionalParent = MyParentPage.GetInfo();
    return conditionalParent.UserCanAccessPageAndAllControls ? conditionalParent : null;
  }

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