-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7908 from abpframework/cotur/cms-kit/media
Cms Kit - MediaDescriptor EntityType Definitions
- Loading branch information
Showing
34 changed files
with
2,458 additions
and
77 deletions.
There are no files selected for viewing
2,012 changes: 2,012 additions & 0 deletions
2,012
...t/Volo.CmsKit.Web.Unified/Migrations/20210302064229_Added_EntityType_to_Media.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
...s-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302064229_Added_EntityType_to_Media.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace Volo.CmsKit.Migrations | ||
{ | ||
public partial class Added_EntityType_to_Media : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<string>( | ||
name: "EntityType", | ||
table: "CmsMediaDescriptors", | ||
type: "nvarchar(64)", | ||
maxLength: 64, | ||
nullable: false, | ||
defaultValue: ""); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "EntityType", | ||
table: "CmsMediaDescriptors"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 30 additions & 1 deletion
31
.../cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminAppServiceBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,39 @@ | ||
namespace Volo.CmsKit.Admin | ||
using JetBrains.Annotations; | ||
using Microsoft.AspNetCore.Authorization; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Runtime.InteropServices.ComTypes; | ||
using System.Threading.Tasks; | ||
using Volo.Abp; | ||
using Volo.Abp.Authorization; | ||
|
||
namespace Volo.CmsKit.Admin | ||
{ | ||
public abstract class CmsKitAdminAppServiceBase : CmsKitAppServiceBase | ||
{ | ||
protected CmsKitAdminAppServiceBase() | ||
{ | ||
ObjectMapperContext = typeof(CmsKitAdminApplicationModule); | ||
} | ||
|
||
/// <summary> | ||
/// Checks given policies until finding granted policy. If none of them is granted, throws <see cref="AbpAuthorizationException"/> | ||
/// </summary> | ||
/// <param name="policies">Policies to be checked.</param> | ||
/// <exception cref="AbpAuthorizationException">Thrown when none of policies is granted.</exception> | ||
protected async Task CheckAnyOfPoliciesAsync([NotNull] IEnumerable<string> policies) | ||
{ | ||
Check.NotNull(policies, nameof(policies)); | ||
|
||
foreach (var policy in policies) | ||
{ | ||
if (await AuthorizationService.IsGrantedAsync(policy)) | ||
{ | ||
return; | ||
} | ||
} | ||
|
||
throw new AbpAuthorizationException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...s/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/CmsKitCommonApplicationModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.