16 changed files with 126 additions and 233 deletions
@ -1,13 +1,14 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "AuthServer.Host.dll"] |
|||
@ -1,13 +1,14 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.ApiGateway.Host.dll"] |
|||
@ -1,13 +1,14 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.ApiGateway.HttpApi.Host.dll"] |
|||
@ -1,139 +0,0 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Security.Claims; |
|||
using System.Security.Principal; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Security.Claims; |
|||
|
|||
namespace Volo.Abp.Authorization.Permissions |
|||
{ |
|||
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] |
|||
[ExposeServices(typeof(IPermissionChecker))] |
|||
public class PermissionChecker : IPermissionChecker |
|||
{ |
|||
protected IPermissionDefinitionManager PermissionDefinitionManager { get; } |
|||
protected ICurrentPrincipalAccessor PrincipalAccessor { get; } |
|||
protected ICurrentTenant CurrentTenant { get; } |
|||
protected IPermissionValueProviderManager PermissionValueProviderManager { get; } |
|||
|
|||
public PermissionChecker( |
|||
ICurrentPrincipalAccessor principalAccessor, |
|||
IPermissionDefinitionManager permissionDefinitionManager, |
|||
ICurrentTenant currentTenant, |
|||
IPermissionValueProviderManager permissionValueProviderManager) |
|||
{ |
|||
PrincipalAccessor = principalAccessor; |
|||
PermissionDefinitionManager = permissionDefinitionManager; |
|||
CurrentTenant = currentTenant; |
|||
PermissionValueProviderManager = permissionValueProviderManager; |
|||
} |
|||
|
|||
public virtual async Task<bool> IsGrantedAsync(string name) |
|||
{ |
|||
return await IsGrantedAsync(PrincipalAccessor.Principal, name); |
|||
} |
|||
|
|||
public virtual async Task<bool> IsGrantedAsync( |
|||
ClaimsPrincipal claimsPrincipal, |
|||
string name) |
|||
{ |
|||
Check.NotNull(name, nameof(name)); |
|||
|
|||
var permission = PermissionDefinitionManager.Get(name); |
|||
|
|||
if (!permission.IsEnabled) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() |
|||
?? CurrentTenant.GetMultiTenancySide(); |
|||
|
|||
if (!permission.MultiTenancySide.HasFlag(multiTenancySide)) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
var isGranted = false; |
|||
var context = new PermissionValueCheckContext(permission, claimsPrincipal); |
|||
foreach (var provider in PermissionValueProviderManager.ValueProviders) |
|||
{ |
|||
if (context.Permission.Providers.Any() && |
|||
!context.Permission.Providers.Contains(provider.Name)) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
var result = await provider.CheckAsync(context); |
|||
|
|||
if (result == PermissionGrantResult.Granted) |
|||
{ |
|||
isGranted = true; |
|||
} |
|||
else if (result == PermissionGrantResult.Prohibited) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
return isGranted; |
|||
} |
|||
|
|||
public async Task<MultiplePermissionGrantResult> IsGrantedAsync(string[] names) |
|||
{ |
|||
return await IsGrantedAsync(PrincipalAccessor.Principal, names); |
|||
} |
|||
|
|||
public async Task<MultiplePermissionGrantResult> IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string[] names) |
|||
{ |
|||
Check.NotNull(names, nameof(names)); |
|||
|
|||
var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() ?? CurrentTenant.GetMultiTenancySide(); |
|||
|
|||
var result = new MultiplePermissionGrantResult(); |
|||
if (!names.Any()) |
|||
{ |
|||
return result; |
|||
} |
|||
|
|||
var permissionDefinitions = new List<PermissionDefinition>(); |
|||
foreach (var name in names) |
|||
{ |
|||
var permission = PermissionDefinitionManager.Get(name); |
|||
|
|||
result.Result.Add(name, PermissionGrantResult.Undefined); |
|||
|
|||
if (permission.IsEnabled && permission.MultiTenancySide.HasFlag(multiTenancySide)) |
|||
{ |
|||
permissionDefinitions.Add(permission); |
|||
} |
|||
} |
|||
|
|||
foreach (var provider in PermissionValueProviderManager.ValueProviders) |
|||
{ |
|||
var context = new PermissionValuesCheckContext( |
|||
permissionDefinitions.Where(x => !x.Providers.Any() || x.Providers.Contains(provider.Name)).ToList(), |
|||
claimsPrincipal); |
|||
|
|||
var multipleResult = await provider.CheckAsync(context); |
|||
foreach (var grantResult in multipleResult.Result.Where(grantResult => |
|||
result.Result.ContainsKey(grantResult.Key) && |
|||
result.Result[grantResult.Key] == PermissionGrantResult.Undefined && |
|||
grantResult.Value != PermissionGrantResult.Undefined)) |
|||
{ |
|||
result.Result[grantResult.Key] = grantResult.Value; |
|||
permissionDefinitions.RemoveAll(x => x.Name == grantResult.Key); |
|||
} |
|||
|
|||
if (result.AllGranted || result.AllProhibited) |
|||
{ |
|||
break; |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +1,14 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.Abp.IdentityServer4.HttpApi.Host.dll"] |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.Abp.IdentityServer4.HttpApi.Host.dll"] |
|||
|
|||
@ -1,13 +1,14 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.Abp.LocalizationManagement.HttpApi.Host.dll"] |
|||
@ -1,13 +1,14 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.Abp.MessageService.HttpApi.Host.dll"] |
|||
@ -1,13 +1,15 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs", "./app/file-blob-storing" ] |
|||
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 |
|||
LABEL maintainer="colin.in@foxmail.com" |
|||
WORKDIR /app |
|||
|
|||
COPY . /app |
|||
|
|||
ENV TZ=Asia/Shanghai |
|||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone |
|||
|
|||
EXPOSE 80/tcp |
|||
VOLUME [ "./app/Logs" ] |
|||
VOLUME [ "./app/Modules" ] |
|||
VOLUME [ "./app/file-blob-storing" ] |
|||
|
|||
ENTRYPOINT ["dotnet", "LINGYUN.Platform.HttpApi.Host.dll"] |
|||
Loading…
Reference in new issue