forked from EtchUK/Etch.OrchardCore.ContentPermissions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Migrations.cs
41 lines (31 loc) · 1.08 KB
/
Migrations.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
using System.Threading.Tasks;
namespace Etch.OrchardCore.ContentPermissions
{
public class Migrations : DataMigration
{
#region Dependencies
private readonly IContentDefinitionManager _contentDefinitionManager;
#endregion
#region Constructor
public Migrations(IContentDefinitionManager contentDefinitionManager)
{
_contentDefinitionManager = contentDefinitionManager;
}
#endregion
#region Migrations
public async Task<int> CreateAsync()
{
await _contentDefinitionManager.AlterPartDefinitionAsync("ContentPermissionsPart", builder => builder
.Attachable()
.WithDescription("Provides ability to control which roles can view content item.")
.WithDisplayName("Content Permissions")
.WithDefaultPosition("10")
);
return 1;
}
#endregion
}
}