public List <string> GetUserPermissionCodesByType(string userCode, com.Sconit.CodeMaster.PermissionCategoryType permissionType) { IList <UserPermissionView> permissionList = securityMgr.GetUserPermissions(userCode, permissionType); if (permissionList != null && permissionList.Count > 0) { return(permissionList.Select(p => p.PermissionCode).Distinct().ToList()); } return(null); }
public ActionResult _AjaxLoadingPermissionCategory(com.Sconit.CodeMaster.PermissionCategoryType permissionCategoryType) { IList <PermissionCategory> permissionCategoryList = base.genericMgr.FindAll <PermissionCategory>(selectPermissionCategoryStatement, permissionCategoryType); if (permissionCategoryList == null) { permissionCategoryList = new List <PermissionCategory>(); } this.TranslatePermissionCategory(permissionCategoryList); return(new JsonResult { Data = new SelectList(permissionCategoryList, "Code", "Description") }); }
public IList <UserPermissionView> GetUserPermissions(string userCode, com.Sconit.CodeMaster.PermissionCategoryType categoryType) { User user = GetUser(userCode); if (user != null) { IList <UserPermissionView> permissionList = GetUserPermission(user); if (permissionList != null) { return(permissionList.Where(p => p.PermissionCategoryType == categoryType).ToList()); } else { return(null); } } else { return(null); } }