public async Task <IViewComponentResult> InvokeAsync()
        {
            var roles = ((ClaimsPrincipal)User).GetSpecificClaim("Roles");
            List <FunctionViewModel> functions;

            if (roles.Split(";").Contains(CommonConstants.AppRole.AdminRole))
            {
                functions = await _functionRepository.GetAll(string.Empty);
            }
            else
            {
                //TODO: Get by permission
                functions = await _functionRepository.GetAll(string.Empty);
            }
            return(View(functions));
        }
Esempio n. 2
0
 public IEnumerable <Function> GetAll()
 {
     return(_functionRepository.GetAll());
 }
Esempio n. 3
0
 public IEnumerable <Function> GetFunctions()
 {
     return(Func_repo.GetAll().OrderByDescending(a => a.FunctionId));
 }
Esempio n. 4
0
        public IEnumerable <FunctionDTO> GetAll()
        {
            IEnumerable <Function> f1 = functionRepository.GetAll();

            return(f1.MappingDtos());
        }