Example #1
0
        private bool DisableAccessForHandheldUser(long RID)
        {
            var moduleaccess = moduleAccessRepository.GetAll(true).Where(rid => rid.RoleID == RID);

            if (moduleaccess != null)
            {
                Regex regEx = new Regex("Handheld");
                return(moduleaccess.Any(mod => regEx.IsMatch(mod.ModuleAccessCtrl.Module) && mod.IsAllow));
            }

            return(false);
        }
Example #2
0
        public bool Initialize(string AuthenticatedUser, string ModuleName)
        {
            var authuser = userRepository.GetUserByUserName(AuthenticatedUser);

            if (authuser != null)
            {
                var moduleaccess = moduleAccessRepository.GetAll(true).Where(name => name.ModuleAccessCtrl.Module == ModuleName);
                if (moduleaccess != null)
                {
                    bool IsAllow = moduleaccess.Where(r => r.Role.ID == authuser.RoleID).Select(ok => ok.IsAllow).FirstOrDefault();
                    return(IsAllow);
                }
            }
            return(false);
        }
Example #3
0
 public IEnumerable <ModuleAccessCtrlTransaction> GetAll()
 {
     return(moduleAccessCtrlTransactionRepository.GetAll());
 }