Created
August 5, 2016 14:31
-
-
Save casper-rasmussen/4458f8b3fb7e5bdb72ded4ea3bdfd86b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IsEditingCommerceRole : VirtualRoleProviderBase | |
{ | |
public const string Name = "IsEditingCommerceRole"; | |
private readonly IContentRepository _contentRepository; | |
public IsEditingCommerceRole() | |
{ | |
this._contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>(); | |
} | |
public override bool IsInVirtualRole(IPrincipal principal, object context) | |
{ | |
IContent startPage = this._contentRepository.Get<IContent>(ContentReference.StartPage); | |
//Replace logic with your logic on how to determine what site editor visits. | |
return startPage is CommerceSiteStartPage; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment