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));
        }
 public IEnumerable <Function> GetAll()
 {
     return(_functionRepository.GetAll());
 }
Example #3
0
 public IEnumerable <Function> GetFunctions()
 {
     return(Func_repo.GetAll().OrderByDescending(a => a.FunctionId));
 }
Example #4
0
        public IEnumerable <FunctionDTO> GetAll()
        {
            IEnumerable <Function> f1 = functionRepository.GetAll();

            return(f1.MappingDtos());
        }