This is a role that will allow you to filter on the Remote IP, remote host, Url Referer and user agent – and only if the current request matches your filters, will the user be in that role.
You define it in web.config in the <virtualRoles> section like this:

<add name="LocalOnly" type="EPiServer.Research.VirtualRoles.RemoteFilterRole, VirtualRolesSamplePack" ip="127.0.0.1"/>


In this case it filters on the IP address, to ensure that only local requests will be in that role. It will appear in edit/admin mode as any other role, with the name you provide (in this case “LocalOnly”). The filter parameters you can add in web.config are:
  • ip. If set, the Remote IP should contain this string. Useful if you want to make sure that all your employees automatically have access to internal information as long as they access it from a company computer. Note that IP’s look a lot differently when you use IPv6.
  • host. If set, the Remote Host should contain this string. E.g. “.dk” would ensure that only visitors from a resolved hostname of “.dk” would be in the role.
  • agent. If set, the User agent should contain this string. In case there’s a page you only want cell-phone users, or Firefox browsers to see :-)
  • referer. If set, the referring url should contain this string. This could be useful if you have a piece of role based content that contains information you want to direct to people coming straight from google for instance.
If more than one filter is set, an implicit AND will be applied between them, e.g. the request needs to meet all the demands.

Last edited Nov 2, 2009 at 7:04 PM by AllanThraen, version 1

Comments

No comments yet.