public async Task <bool> AllowedAsync(string loggedInUserId,
                                              string createdBy, string module, string type, string action)
        {
            if (!string.IsNullOrEmpty(loggedInUserId) && loggedInUserId == createdBy)
            {
                return(true);
            }

            if (!string.IsNullOrEmpty(loggedInUserId))
            {
                var request = $"{API_URL}?module={module}&type={type}&action={action}";
                return(await AuthorizedHttpClient.GetFromJsonAsync <bool>(request));
            }
            else
            {
                var request = $"{API_URL}/GuestAllowed?module={module}&type={type}&action={action}";
                return(await PublicHttpClient.GetFromJsonAsync <bool>(request));
            }
        }
Esempio n. 2
0
        public async Task <Category> GetBySlugAsync(string slug, string module)
        {
            var request = $"{API_URL}/GetBySlug?slug={slug}&module={module}";

            return(await PublicHttpClient.GetFromJsonAsync <Category>(request));
        }
Esempio n. 3
0
        public async Task <Category[]> GetAllAsync(string module)
        {
            var request = $"{API_URL}/GetAll?module={module}";

            return(await PublicHttpClient.GetFromJsonAsync <Category[]>(request));
        }
Esempio n. 4
0
        public async Task <Category> GetAsync(string id)
        {
            var request = $"{API_URL}?id={id}";

            return(await PublicHttpClient.GetFromJsonAsync <Category>(request));
        }
        public async Task <Setting[]> SidebarMenuSettingsAsync()
        {
            var request = $"{API_URL}/SidebarMenuSettings";

            return(await PublicHttpClient.GetFromJsonAsync <Setting[]>(request));
        }