I am working on cms page restriction for specific customer group.I am using controller_action_predispatch event observer to check whether the current page is set for restriction and the current customer's group is allowed to visit the page. If customer's group is not allowed I am redirecting them to a error page. The real problem is, they should be allowed to visit the error page on observer redirection, in case of direct url access they shouldn't be allowed to visit that error page. I was trying to set post parameter on observer redirection, so that page could know they are coming from observer redirection. On direct URL access of that page, parameter won't be set. Then I could redirect them to home page. But I couldn't be able to find a solution to set a post param in observer redirection. Also tried using session variable and session cookie but not working well. Is there any solution for this?
Sorry for the long description. Thanks in advance.