- 89
Hi there!
Could you please include PermissionProvider in all your plugins?
Should be nice allow access to each customer role.
Here is a sample, its is very simple (Replace XXX by plugin name):
in plugin install and uninstall method, just include:
and
Thanks!!!
Could you please include PermissionProvider in all your plugins?
Should be nice allow access to each customer role.
Here is a sample, its is very simple (Replace XXX by plugin name):
namespace Nop.Plugin.XXX.Security
{
public partial class XXXPermissionProvider : IPermissionProvider
{
public static readonly PermissionRecord AccessXXX = new PermissionRecord { Name = "Plugins. XXX", SystemName = "AccessXXX", Category = "Plugin" };
public virtual IEnumerable<PermissionRecord> GetPermissions()
{
return new[]
{
AccessXXX,
};
}
public virtual IEnumerable<DefaultPermissionRecord> GetDefaultPermissions()
{
return Enumerable.Empty<DefaultPermissionRecord>();
}
}
}
in plugin install and uninstall method, just include:
_permissionService.InstallPermissions(new XXXPermissionProvider());
and
_permissionService.UninstallPermissions(new XXXPermissionProvider());
Thanks!!!