private ModuleDictionary CreateObject(IDataReader oReader)
        {
            ModuleDictionary objModuleDictionary = new ModuleDictionary();

            NullManager reader = new NullManager(oReader);

            try
            {
                objModuleDictionary.TotalPrivilege = (int)reader.GetByte("TotalPrivilege");
                objModuleDictionary.MenuName       = reader.GetString("MenuName");
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating object" + Ex.Message);
            }
            return(objModuleDictionary);
        }
Esempio n. 2
0
        private async Task <bool> CheckResponsePrerequisite(ModuleDictionary dictionary, Guid moduleId)
        {
            SymHackUser user = await UserManager.FindByIdAsync(User.Identity.GetUserId());

            String log;

            if (user == null)
            {
                log = CookieWrapper.GuestLog;
            }
            else
            {
                log = ModuleManager?.GetUserModuleById(new Guid(user.Id))?.Log;
            }

            return(Regex.IsMatch(log, Regex.Unescape(dictionary.Prerequisite)));
        }