private bool HasPermission(IMenuItem menuItem)
        {
            bool hasPermission = false;

            if (menuItem.HasPluginAssigned)
            {
                var permissionHandler = new PermissionHandler();
                hasPermission = permissionHandler.HasPermissionOnPlugin(menuItem.Plugin);
            }

            return(hasPermission);
        }
示例#2
0
        public List <IPlugin> GetPluginsAllowed()
        {
            var plugins           = new List <IPlugin>();
            var permissionHandler = new PermissionHandler();

            foreach (IPlugin plugin in _plugins)
            {
                if (plugin.IsValid && permissionHandler.HasPermissionOnPlugin(plugin))
                {
                    plugins.Add(plugin);
                }
            }

            return(plugins);
        }
示例#3
0
        public List <IPluginSummary> GetPluginSummaryAllowed()
        {
            var plugins           = new List <IPluginSummary>();
            var permissionHandler = new PermissionHandler();

            foreach (IPlugin plugin in _plugins)
            {
                if (permissionHandler.HasPermissionOnPlugin(plugin))
                {
                    plugins.Add(PluginSummary.CreateSummary(plugin));
                }
            }

            return(plugins);
        }