Beispiel #1
0
        public async Task <IEnumerable <string> > GetPermissionsForCurrentUserAsync()
        {
            var permissions = (await _webUserContextService.GetClaimsForCurrentUserAsync())
                              .Select(c => c);

            return(permissions);
        }
Beispiel #2
0
        private async Task <IEnumerable <string> > GetAllowedGroupIdsForLoggedInUserAsync(string permissionKey)
        {
            var claims = await _webUserContextService.GetClaimsForCurrentUserAsync();

            var allowedGroupIds = claims
                                  .Where(c => c.EndsWith(permissionKey))
                                  .Select(c => c.Split(':')[0]).Distinct();

            return(allowedGroupIds);
        }