You do not have permission to view this content: unhelpful error

When our client sets WCM content up that requires login, and is restricted to specific groups of users (roles and/or member types) using the access settings, and then link navigation items from the site map to that content, they want people to be directed to a login screen.  Instead, site visitors are directed to a generic (and unhelpful) screen with URL http://www.xxxclientname.org.au/WCM/Error.aspx?iErrorType=Asi.Security.A... and message: You do not have permission to view this content.  The message is preceded by the standard iMIS warning triangle with red text ERROR.
 
Is it possible to change this behaviour?  How?  We have logged a call with tech support who advise that it has already been logged as an enhancement, but want to be clear that it is not possible.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Any response

Hi Conrad,

 

We have a similar problem and just curious to know if you had any response or solution to this problem of yours.

The Error triangle and the text "You do not have permission to view this content" is really not help ful. Is there a way we can edit the text or provide a link to the end user to login or advising them to be financial or similar.

Grateful if you could share the solution.

Thanks

Vig

Edit the image

We edited the image ..\ASI\iMIS15\Net\AsiCommon\Images\error.gif to provide a (slightly) more helpful message.

Conrad

Another change

Thnx Conrad. We made some temporary changes with some text in the error.aspx to reflect some helpful text :-)

Issues with edits to error.aspx?

Have either of you come across issues with other errors that might not be specifically addressing the permission to view content?

Isn't this designed to be a generic error page and display a variety of potential errors? Wouldn't a better method be to identify where the ErrorType definition is made and make changes to the text there for the AccessDenied security ErrorType? I don't know where that is defined... yet.

  I ended up putting a

 

I ended up putting a little .NET code on the page to re-direct the user to the login if they were not logged in. If they are logged in and they get this then they do not have the required access and I send them to a "You don't have access" page. A simple enough workaround.

 

thank you

Nice. Thanks, that gave me some ideas. Did you hardcode the redirects? are you able to login and bring them to the page that they were trying to access? (if so, care to show your methods)

In the case of this client,

In the case of this client, there is only one security group so it is pretty easy. If there were multiple groups you would probably want to see where the request came from to determine which no access message to show them. This is a sample. Not sure if ASI would approve of hacking the Error page. Would be cleaner as an HTTPMODULE but have not had the free time to convert it. Have fun.

 

<script runat="server">
    protected override void OnPreRender(EventArgs e)
    {
        if (Request.QueryString["iErrorType"].ToString() == "Asi.Security.AccessDenied")
        {
                if (Asi.Security.AppPrincipal.CurrentIdentity.IsAuthenticated && Asi.Security.AppPrincipal.CurrentIdentity.LoginUserId != "")
                {
                    /* we are already logged in so we must be non member */
                    Response.Redirect("http://yoursite.com/NoAccess.aspx");
                }
                else
                {

                    Response.Redirect("https://yoursite.com/AsiCommon/Controls/Shared/FormsAuthentication/Login.aspx?returnURL=https://yoursite.com/imis15_prod/Members/MemberContent.aspx");
                }
        }
          
        base.OnPreRender(e);

    }

</script>
 

Thanks!

Joe,
I appreciate your help, I will contribute for anyone who reads this down the road.

Instead of hardcoding the login link, I used the FormsAuthentication.LoginUrl with the returnURL as the referrer (it doesn't take you back to the page you were trying to get to, but it does take you back to the page you were on when you clicked the link, which isn't too bad), makes it a little more dynamic.

Response.Redirect(System.Web.Security.FormsAuthentication.LoginUrl + "?returnURL=" + Request.UrlReferrer);

Yes, this is a nice

Yes, this is a nice addition. Thanks