mirror of https://github.com/abpframework/abp.git
committed by
GitHub
53 changed files with 282 additions and 166 deletions
|
After Width: | Height: | Size: 154 KiB |
@ -0,0 +1,13 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.FlagIconCss |
|||
{ |
|||
public class FlagIconCssStyleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/flag-icon-css/css/flag-icon.min.css"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
using System.Security.Claims; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Authorization.Permissions |
|||
{ |
|||
public static class PermissionCheckerExtensions |
|||
{ |
|||
public static async Task<bool> IsGrantedAsync(this IPermissionChecker permissionChecker, string name) |
|||
{ |
|||
return (await permissionChecker.CheckAsync(name)).IsGranted; |
|||
} |
|||
|
|||
public static async Task<bool> IsGrantedAsync(this IPermissionChecker permissionChecker, ClaimsPrincipal principal, string name) |
|||
{ |
|||
return (await permissionChecker.CheckAsync(principal, name)).IsGranted; |
|||
} |
|||
|
|||
//TODO: Add sync extensions
|
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
namespace Volo.Abp.Authorization.Permissions |
|||
{ |
|||
public enum PermissionGrantResult |
|||
{ |
|||
Undefined, |
|||
Granted, |
|||
Prohibited |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Threading |
|||
{ |
|||
public static class TaskCache |
|||
{ |
|||
public static Task<bool> TrueResult { get; } |
|||
public static Task<bool> FalseResult { get; } |
|||
|
|||
static TaskCache() |
|||
{ |
|||
TrueResult = Task.FromResult(true); |
|||
FalseResult = Task.FromResult(false); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.Features</AssemblyName> |
|||
<PackageId>Volo.Abp.Features</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.Localization.Abstractions\Volo.Abp.Localization.Abstractions.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.MultiTenancy.Abstractions\Volo.Abp.MultiTenancy.Abstractions.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace Volo.Abp.Features |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpLocalizationAbstractionsModule), |
|||
typeof(AbpMultiTenancyAbstractionsModule) |
|||
)] |
|||
public class AbpFeaturesModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using Shouldly; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.TestApp.Domain; |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.TestApp.Testing |
|||
{ |
|||
public class HasExtraPropertiesExtensions_Tests |
|||
{ |
|||
[Fact] |
|||
public void Basic_Tests() |
|||
{ |
|||
var city = new City(Guid.NewGuid(), "Adana"); |
|||
|
|||
city.HasProperty("UnknownProperty").ShouldBeFalse(); |
|||
city.GetProperty("UnknownProperty").ShouldBeNull(); |
|||
city.GetProperty<int>("UnknownProperty").ShouldBe(0); |
|||
|
|||
city.SetProperty("IsHot", true); |
|||
city.HasProperty("IsHot").ShouldBeTrue(); |
|||
city.GetProperty<bool>("IsHot").ShouldBeTrue(); |
|||
|
|||
city.SetProperty("IsHot", false); |
|||
city.HasProperty("IsHot").ShouldBeTrue(); |
|||
city.GetProperty<bool>("IsHot").ShouldBeFalse(); |
|||
|
|||
city.RemoveProperty("IsHot"); |
|||
city.HasProperty("IsHot").ShouldBeFalse(); |
|||
city.GetProperty<bool>("IsHot").ShouldBeFalse(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,8 +1,8 @@ |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Authorization.Permissions |
|||
namespace Volo.Abp.PermissionManagement |
|||
{ |
|||
public class PermissionValueProviderGrantInfo |
|||
public class PermissionValueProviderGrantInfo //TODO: Rename to PermissionGrantInfo
|
|||
{ |
|||
public static PermissionValueProviderGrantInfo NonGranted { get; } = new PermissionValueProviderGrantInfo(false); |
|||
|
|||
@ -0,0 +1,6 @@ |
|||
module.exports = { |
|||
mappings: { |
|||
"@node_modules/flag-icon-css/css/*": "@libs/flag-icon-css/css", |
|||
"@node_modules/flag-icon-css/flags/1x1/*": "@libs/flag-icon-css/flags/1x1" |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
{ |
|||
"version": "0.5.2", |
|||
"name": "@abp/flag-icon-css", |
|||
"publishConfig": { |
|||
"access": "public" |
|||
}, |
|||
"dependencies": { |
|||
"flag-icon-css": "^3.3.0" |
|||
} |
|||
} |
|||
Loading…
Reference in new issue