Browse Source

Merge branch 'master' of github.com:Squidex/squidex

pull/341/head v1.14.0
Sebastian Stehle 7 years ago
parent
commit
1131e4f825
  1. 2
      src/Squidex.Domain.Apps.Entities/Apps/RoleExtensions.cs
  2. 6
      src/Squidex.Domain.Users/UserWithClaims.cs
  3. 2
      src/Squidex.Shared/Users/IUser.cs
  4. 4
      src/Squidex/app/framework/angular/forms/iframe-editor.component.ts
  5. 11
      tests/Squidex.Domain.Apps.Entities.Tests/Apps/RoleExtensionsTests.cs

2
src/Squidex.Domain.Apps.Entities/Apps/RoleExtensions.cs

@ -30,7 +30,7 @@ namespace Squidex.Domain.Apps.Entities.Apps
}
}
permissions = result;
permissions = result.Distinct().ToArray();
return permissions;
}

6
src/Squidex.Domain.Users/UserWithClaims.cs

@ -5,6 +5,7 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
@ -30,6 +31,11 @@ namespace Squidex.Domain.Users
get { return Identity.Email; }
}
public bool IsLocked
{
get { return Identity.LockoutEnd > DateTime.Now.ToUniversalTime(); }
}
IReadOnlyList<Claim> IUser.Claims
{
get { return Claims; }

2
src/Squidex.Shared/Users/IUser.cs

@ -16,6 +16,8 @@ namespace Squidex.Shared.Users
string Email { get; }
bool IsLocked { get; }
IReadOnlyList<Claim> Claims { get; }
}
}

4
src/Squidex/app/framework/angular/forms/iframe-editor.component.ts

@ -65,7 +65,7 @@ export class IFrameEditorComponent implements ControlValueAccessor, AfterViewIni
this.isInitialized = true;
if (this.plugin.contentWindow && Types.isFunction(this.plugin.contentWindow.postMessage)) {
this.plugin.contentWindow.postMessage({ type: 'disabled', disabled: this.isDisabled }, '*');
this.plugin.contentWindow.postMessage({ type: 'disabled', isDisabled: this.isDisabled }, '*');
this.plugin.contentWindow.postMessage({ type: 'valueChanged', value: this.value }, '*');
}
} else if (type === 'resize') {
@ -99,7 +99,7 @@ export class IFrameEditorComponent implements ControlValueAccessor, AfterViewIni
this.isDisabled = isDisabled;
if (this.isInitialized && this.plugin.contentWindow && Types.isFunction(this.plugin.contentWindow.postMessage)) {
this.plugin.contentWindow.postMessage({ type: 'disabled', disabled: this.isDisabled }, '*');
this.plugin.contentWindow.postMessage({ type: 'disabled', isDisabled: this.isDisabled }, '*');
}
}

11
tests/Squidex.Domain.Apps.Entities.Tests/Apps/RoleExtensionsRests.cs → tests/Squidex.Domain.Apps.Entities.Tests/Apps/RoleExtensionsTests.cs

@ -12,7 +12,7 @@ using Xunit;
namespace Squidex.Domain.Apps.Entities.Apps
{
public class RoleExtensionsRests
public class RoleExtensionsTests
{
[Fact]
public void Should_add_common_permission()
@ -23,6 +23,15 @@ namespace Squidex.Domain.Apps.Entities.Apps
Assert.Equal(new[] { "squidex.apps.my-app.common" }, result);
}
[Fact]
public void Should_not_have_duplicate_permission()
{
var source = new[] { "common", "common", "common" };
var result = source.Prefix("my-app");
Assert.Single(result);
}
[Fact]
public void Should_prefix_permission()
{
Loading…
Cancel
Save