Skip to content

Commit

Permalink
Upgraded to ABP 0.5.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalkan committed Mar 9, 2015
1 parent 32a4764 commit 9193f96
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 74 deletions.
8 changes: 4 additions & 4 deletions src/Abp.Zero.EntityFramework/Abp.Zero.EntityFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
<DocumentationFile>bin\Release\Abp.Zero.EntityFramework.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Abp, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Abp.0.5.5.0\lib\net451\Abp.dll</HintPath>
<HintPath>..\packages\Abp.0.5.6.0\lib\net451\Abp.dll</HintPath>
</Reference>
<Reference Include="Abp.EntityFramework, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp.EntityFramework, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Abp.EntityFramework.0.5.5.0\lib\net451\Abp.EntityFramework.dll</HintPath>
<HintPath>..\packages\Abp.EntityFramework.0.5.6.0\lib\net451\Abp.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/Abp.Zero.EntityFramework/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Abp" version="0.5.5.0" targetFramework="net451" />
<package id="Abp.EntityFramework" version="0.5.5.0" targetFramework="net451" />
<package id="Abp" version="0.5.6.0" targetFramework="net451" />
<package id="Abp.EntityFramework" version="0.5.6.0" targetFramework="net451" />
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />
Expand Down
12 changes: 6 additions & 6 deletions src/Abp.Zero.NHibernate/Abp.Zero.NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
<DocumentationFile>bin\Release\Abp.Zero.NHibernate.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Abp, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Abp.0.5.5.0\lib\net451\Abp.dll</HintPath>
<HintPath>..\packages\Abp.0.5.6.0\lib\net451\Abp.dll</HintPath>
</Reference>
<Reference Include="Abp.FluentMigrator, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp.FluentMigrator, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Abp.FluentMigrator.0.5.5.0\lib\net451\Abp.FluentMigrator.dll</HintPath>
<HintPath>..\packages\Abp.FluentMigrator.0.5.6.0\lib\net451\Abp.FluentMigrator.dll</HintPath>
</Reference>
<Reference Include="Abp.NHibernate, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp.NHibernate, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Abp.NHibernate.0.5.5.0\lib\net451\Abp.NHibernate.dll</HintPath>
<HintPath>..\packages\Abp.NHibernate.0.5.6.0\lib\net451\Abp.NHibernate.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
6 changes: 3 additions & 3 deletions src/Abp.Zero.NHibernate/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Abp" version="0.5.5.0" targetFramework="net451" />
<package id="Abp.FluentMigrator" version="0.5.5.0" targetFramework="net451" />
<package id="Abp.NHibernate" version="0.5.5.0" targetFramework="net451" />
<package id="Abp" version="0.5.6.0" targetFramework="net451" />
<package id="Abp.FluentMigrator" version="0.5.6.0" targetFramework="net451" />
<package id="Abp.NHibernate" version="0.5.6.0" targetFramework="net451" />
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />
Expand Down
5 changes: 2 additions & 3 deletions src/Abp.Zero/Abp.Zero.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<DocumentationFile>bin\Release\Abp.Zero.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Abp, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Abp.0.5.5.0\lib\net451\Abp.dll</HintPath>
<HintPath>..\packages\Abp.0.5.6.0\lib\net451\Abp.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -104,7 +104,6 @@
<Compile Include="Authorization\Users\UserLogin.cs" />
<Compile Include="Zero\AbpZeroCoreModule.cs" />
<Compile Include="Utils\Helpers\RandomHelper.cs" />
<Compile Include="Zero\Configuration\MultiTenancyConfig.cs" />
<Compile Include="Zero\Configuration\ModuleZeroConfigurationExtensions.cs" />
<Compile Include="Zero\Configuration\ZeroConfig.cs" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/Abp.Zero/Authorization/Users/AbpUserManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Security.Claims;
using System.Threading.Tasks;
using Abp.Authorization.Roles;
using Abp.Configuration.Startup;
using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.Extensions;
Expand Down Expand Up @@ -39,14 +40,14 @@ private IUserPermissionStore<TTenant, TUser> UserPermissionStore
private readonly IPermissionManager _permissionManager;
private readonly AbpRoleManager<TTenant, TRole, TUser> _roleManager;
private readonly IRepository<TTenant> _tenantRepository;
private readonly MultiTenancyConfig _multiTenancyConfig;
private readonly IMultiTenancyConfig _multiTenancyConfig;
private readonly AbpUserStore<TTenant, TRole, TUser> _abpUserStore;

protected AbpUserManager(
AbpUserStore<TTenant, TRole, TUser> userStore,
AbpRoleManager<TTenant, TRole, TUser> roleManager,
IRepository<TTenant> tenantRepository,
MultiTenancyConfig multiTenancyConfig,
IMultiTenancyConfig multiTenancyConfig,
IPermissionManager permissionManager)
: base(userStore)
{
Expand Down
20 changes: 16 additions & 4 deletions src/Abp.Zero/Runtime/Session/AbpSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using System.Linq;
using System.Security.Claims;
using System.Threading;
using Abp.Configuration.Startup;
using Abp.Dependency;
using Abp.MultiTenancy;
using Abp.Runtime.Security;
using Abp.Zero.Configuration;
using Microsoft.AspNet.Identity;
Expand All @@ -14,8 +16,6 @@ namespace Abp.Runtime.Session
/// </summary>
public class AbpSession : IAbpSession, ISingletonDependency
{
private readonly MultiTenancyConfig _multiTenancy;

public long? UserId
{
get
Expand All @@ -36,7 +36,7 @@ public int? TenantId
{
if (!_multiTenancy.IsEnabled)
{
return 1; //TODO: This assumption is not good!
return 1; //TODO@hikalkan: This assumption may not be good?
}

var claimsPrincipal = Thread.CurrentPrincipal as ClaimsPrincipal;
Expand All @@ -55,10 +55,22 @@ public int? TenantId
}
}

public MultiTenancySide MultiTenancySide
{
get
{
return _multiTenancy.IsEnabled && !TenantId.HasValue
? MultiTenancySide.Host
: MultiTenancySide.Tenant;
}
}

private readonly IMultiTenancyConfig _multiTenancy;

/// <summary>
/// Constructor.
/// </summary>
public AbpSession(MultiTenancyConfig multiTenancy)
public AbpSession(IMultiTenancyConfig multiTenancy)
{
_multiTenancy = multiTenancy;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Abp.Zero/Zero/AbpZeroCoreModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ public class AbpZeroCoreModule : AbpModule
/// <summary>
/// Current version of the zero module.
/// </summary>
public const string CurrentVersion = "0.5.7.0";
public const string CurrentVersion = "0.5.8.0";

public override void PreInitialize()
{
IocManager.Register<MultiTenancyConfig>();
IocManager.Register<ZeroConfig>();
}

Expand Down
14 changes: 0 additions & 14 deletions src/Abp.Zero/Zero/Configuration/MultiTenancyConfig.cs

This file was deleted.

12 changes: 0 additions & 12 deletions src/Abp.Zero/Zero/Configuration/ZeroConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
/// </summary>
public class ZeroConfig
{
/// <summary>
/// Multi tenancy configuration.
/// </summary>
public MultiTenancyConfig MultiTenancy { get; private set; }

/// <summary>
/// Constructor.
/// </summary>
/// <param name="multiTenancy">Multi tenancy configuration</param>
public ZeroConfig(MultiTenancyConfig multiTenancy)
{
MultiTenancy = multiTenancy;
}
}
}
2 changes: 1 addition & 1 deletion src/Abp.Zero/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Abp" version="0.5.5.0" targetFramework="net451" />
<package id="Abp" version="0.5.6.0" targetFramework="net451" />
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Abp, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Abp.0.5.5.0\lib\net451\Abp.dll</HintPath>
<HintPath>..\..\packages\Abp.0.5.6.0\lib\net451\Abp.dll</HintPath>
</Reference>
<Reference Include="Abp.EntityFramework, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp.EntityFramework, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Abp.EntityFramework.0.5.5.0\lib\net451\Abp.EntityFramework.dll</HintPath>
<HintPath>..\..\packages\Abp.EntityFramework.0.5.6.0\lib\net451\Abp.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Abp.TestBase, Version=0.1.3.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp.TestBase, Version=0.1.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Abp.TestBase.0.1.3.0\lib\net451\Abp.TestBase.dll</HintPath>
<HintPath>..\..\packages\Abp.TestBase.0.1.4.0\lib\net451\Abp.TestBase.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
9 changes: 5 additions & 4 deletions src/Tests/Abp.Zero.SampleApp.Tests/Users/UserLogin_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Abp.Authorization.Users;
using Abp.Configuration.Startup;
using Abp.Zero.Configuration;
using Abp.Zero.SampleApp.MultiTenancy;
using Abp.Zero.SampleApp.Users;
Expand Down Expand Up @@ -50,7 +51,7 @@ public UserLogin_Tests()
[Fact]
public async Task Should_Login_With_Correct_Values_Without_MultiTenancy()
{
Resolve<MultiTenancyConfig>().IsEnabled = false;
Resolve<IMultiTenancyConfig>().IsEnabled = false;
AbpSession.TenantId = 1; //TODO: We should not need to set this and implement AbpSession instead of TestSession.

var loginResult = await _userManager.LoginAsync("user1", "123qwe");
Expand All @@ -62,7 +63,7 @@ public async Task Should_Login_With_Correct_Values_Without_MultiTenancy()
[Fact]
public async Task Should_Not_Login_With_Invalid_UserName_Without_MultiTenancy()
{
Resolve<MultiTenancyConfig>().IsEnabled = false;
Resolve<IMultiTenancyConfig>().IsEnabled = false;
AbpSession.TenantId = 1; //TODO: We should not need to set this and implement AbpSession instead of TestSession.

var loginResult = await _userManager.LoginAsync("wrongUserName", "asdfgh");
Expand All @@ -74,7 +75,7 @@ public async Task Should_Not_Login_With_Invalid_UserName_Without_MultiTenancy()
[Fact]
public async Task Should_Login_With_Correct_Values_With_MultiTenancy()
{
Resolve<MultiTenancyConfig>().IsEnabled = true;
Resolve<IMultiTenancyConfig>().IsEnabled = true;

var loginResult = await _userManager.LoginAsync("user1", "123qwe", "tenant1");
loginResult.Result.ShouldBe(AbpLoginResultType.Success);
Expand All @@ -85,7 +86,7 @@ public async Task Should_Login_With_Correct_Values_With_MultiTenancy()
[Fact]
public async Task Should_Login_TenancyOwner_With_Correct_Values()
{
Resolve<MultiTenancyConfig>().IsEnabled = true;
Resolve<IMultiTenancyConfig>().IsEnabled = true;

var loginResult = await _userManager.LoginAsync("userOwner", "123qwe");
loginResult.Result.ShouldBe(AbpLoginResultType.Success);
Expand Down
6 changes: 3 additions & 3 deletions src/Tests/Abp.Zero.SampleApp.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Abp" version="0.5.5.0" targetFramework="net451" />
<package id="Abp.EntityFramework" version="0.5.5.0" targetFramework="net451" />
<package id="Abp.TestBase" version="0.1.3.0" targetFramework="net451" />
<package id="Abp" version="0.5.6.0" targetFramework="net451" />
<package id="Abp.EntityFramework" version="0.5.6.0" targetFramework="net451" />
<package id="Abp.TestBase" version="0.1.4.0" targetFramework="net451" />
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />
Expand Down
8 changes: 4 additions & 4 deletions src/Tests/Abp.Zero.SampleApp/Abp.Zero.SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Abp, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Abp.0.5.5.0\lib\net451\Abp.dll</HintPath>
<HintPath>..\..\packages\Abp.0.5.6.0\lib\net451\Abp.dll</HintPath>
</Reference>
<Reference Include="Abp.EntityFramework, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Abp.EntityFramework, Version=0.5.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Abp.EntityFramework.0.5.5.0\lib\net451\Abp.EntityFramework.dll</HintPath>
<HintPath>..\..\packages\Abp.EntityFramework.0.5.6.0\lib\net451\Abp.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/Abp.Zero.SampleApp/Users/UserManager.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Abp.Authorization;
using Abp.Authorization.Users;
using Abp.Configuration.Startup;
using Abp.Domain.Repositories;
using Abp.Zero.Configuration;
using Abp.Zero.SampleApp.MultiTenancy;
using Abp.Zero.SampleApp.Roles;

Expand All @@ -13,7 +13,7 @@ public UserManager(
UserStore userStore,
RoleManager roleManager,
IRepository<Tenant> tenantRepository,
MultiTenancyConfig multiTenancyConfig,
IMultiTenancyConfig multiTenancyConfig,
IPermissionManager permissionManager)
: base(
userStore,
Expand Down
4 changes: 2 additions & 2 deletions src/Tests/Abp.Zero.SampleApp/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Abp" version="0.5.5.0" targetFramework="net451" />
<package id="Abp.EntityFramework" version="0.5.5.0" targetFramework="net451" />
<package id="Abp" version="0.5.6.0" targetFramework="net451" />
<package id="Abp.EntityFramework" version="0.5.6.0" targetFramework="net451" />
<package id="Castle.Core" version="3.3.3" targetFramework="net451" />
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />
Expand Down

0 comments on commit 9193f96

Please sign in to comment.