Elsinore

User Forum

www.screenconnect.com
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
Accessrights on custom page
jthoeny
#1 Posted : Monday, February 06, 2012 9:46:36 PM
Rank: Newbie
Joined: 2/3/2012
Posts: 7
Location: Switzerland
I have added a custom page in Default.Master at:
Code:
        if (this.Page.User.Identity.IsAuthenticated)
        {
            linkContainerControls.Add(new HyperLink() { NavigateUrl = ServerConstants.GuestPageUrl, Text = Resources.Default.LinkPanel_GuestLinkText });
            linkContainerControls.Add(new HyperLink() { NavigateUrl = ServerConstants.HostPageUrl, Text = Resources.Default.LinkPanel_HostLinkText });
            linkContainerControls.Add(new HyperLink() { NavigateUrl = "/custompage.aspx", Text = "Custompage Title" });


This works well, but I would like to limit the access to authenticated users. Right now, a user who knows the URL can access the page without authentication. How can I set the access rights of a custom page?

Thanks Juerg
Jake Morgan
#2 Posted : Tuesday, February 07, 2012 12:54:48 AM
Rank: Administration
Joined: 4/9/2010
Posts: 860
Try this line:

Code:


        Permissions.AssertPermission(new PermissionRequest(), false);
jthoeny
#3 Posted : Tuesday, February 07, 2012 7:33:16 AM
Rank: Newbie
Joined: 2/3/2012
Posts: 7
Location: Switzerland
thanks works great.
in vb:

Code:
        dim permissionEntries = Permissions.GetEntriesForUser()
        Permissions.AssertPermission(new PermissionRequest(), permissionEntries, false)

Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.