Hi, is ther anyone who know how to hide a plugin for non-Administrators in EPiServer?
[GuiPlugIn(
DisplayName="All Properties",
Description="Show all properties for the page",
Area=PlugInArea.EditPanel,
Url="~/uppsala/plugin/ShowAllProperties.ascx"
)]
public class ShowAllProperties : EPiServer.UserControlBase
{
protected System.Web.UI.WebControls.DataGrid propertiesDataGrid;
protected System.Web.UI.WebControls.Literal propertiesLiteral;
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
}
else
{
}
}
}
Hi Linus!
If you implement the ICustomPlugInLoader interface, you get
the chance to control wether to load your plugin or not depending
of, for example, user having admin access.
For example:
[GuiPlugIn(
DisplayName="All Properties",
Description="Show all properties for the page",
Area=PlugInArea.EditPanel,
Url="~/uppsala/plugin/ShowAllProperties.ascx"
)]
public class ShowAllProperties : EPiServer.UserControlBase, ICustomPlugInLoader
{
protected System.Web.UI.WebControls.DataGrid propertiesDataGrid;
protected System.Web.UI.WebControls.Literal propertiesLiteral;
PlugInDescriptor[] ICustomPlugInLoader.List()
{
if( !Global.EPConfig.HasAdminAccess )
return new PlugInDescriptor[0];
return new PlugInDescriptor[]{PlugInDescriptor.Load(typeof(ShowAllProperties))};
}
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
}
else
{
}
}
}
Regards,
Johan Olofsson
[GuiPlugIn( DisplayName="All Properties", Description="Show all properties for the page", Area=PlugInArea.EditPanel, Url="~/uppsala/plugin/ShowAllProperties.ascx" )] public class ShowAllProperties : EPiServer.UserControlBase { protected System.Web.UI.WebControls.DataGrid propertiesDataGrid; protected System.Web.UI.WebControls.Literal propertiesLiteral; private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { } else { } } }