private static void InitPrivilegeAndAuthMap() { ModuleService ms = BeanManager.GetInstance <ModuleService>(); AnonymPrivilege = ms.GetAnonymPrivileges(); AnonymAuthMap = ms.GetAnonymAuthMap(); AllPrivilege = ms.GetAllPrivileges(false); }
public PrivilegeCat ModulesToPrivilegeCat(List <ModuleTdm> mlist, bool menuOnly = true) { Dictionary <int, ModuleVdm> mmap = new Dictionary <int, ModuleVdm>(); var pc = new PrivilegeCat(); var publics = pc.Publics; var menus = pc.Menus; var apis = pc.Apis; var funcs = pc.Funcs; var uriMap = pc.UriMap; foreach (ModuleTdm t in mlist) { switch (t.Kind) { case ModuleKind.VGroup: DealWithNotMenuItem(t, mmap, menuOnly, publics, uriMap); break; case ModuleKind.VModule: goto case ModuleKind.VGroup; case ModuleKind.VOP: goto case ModuleKind.VGroup; case ModuleKind.Group: if (!t.Enable || (menuOnly && !t.Visible)) { break; } SaveModule2Collect(t, mmap, menus, uriMap); break; case ModuleKind.Module: goto case ModuleKind.Group; case ModuleKind.OP: DealWithNotMenuItem(t, mmap, menuOnly, menus, uriMap); break; case ModuleKind.AGroup: DealWithNotMenuItem(t, mmap, menuOnly, apis, uriMap); break; case ModuleKind.AModule: goto case ModuleKind.AGroup; case ModuleKind.API: goto case ModuleKind.AGroup; case ModuleKind.FGroup: DealWithNotMenuItem(t, mmap, menuOnly, funcs, uriMap); break; case ModuleKind.FModule: goto case ModuleKind.FGroup; case ModuleKind.Func: goto case ModuleKind.FGroup; } //switch } //for each return(pc); }