Exemplo n.º 1
0
        private async Task <bool> AuthorizationCheck(AuthorizationHandlerContext context, OrganizationUnit resource)
        {
            var userOrganizationUnits = await _userRepository.GetOrganizationUnitsAsync(context.User.FindUserId().Value);

            if (userOrganizationUnits.Any(ou => resource.Code.StartsWith(ou.Code)))
            {
                return(true);
            }

            return(false);
        }