Skip to content

Commit ec64da0

Browse files
stevemegsonnul800sebastiaan
authored andcommitted
Grant access to Packages section for any user groups with access to the Developer section
1 parent 17d91da commit ec64da0

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ protected void DefinePlan()
166166
.As("{0576E786-5C30-4000-B969-302B61E90CA3}");
167167

168168
To<FixLanguageIsoCodeLength>("{48AD6CCD-C7A4-4305-A8AB-38728AD23FC5}");
169+
To<AddPackagesSectionAccess>("{DF470D86-E5CA-42AC-9780-9D28070E25F9}");
169170

170171
// finish migrating from v7 - recreate all keys and indexes
171172
To<CreateKeysAndIndexes>("{3F9764F5-73D0-4D45-8804-1240A66E43A2}");
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
8+
{
9+
public class AddPackagesSectionAccess : MigrationBase
10+
{
11+
public AddPackagesSectionAccess(IMigrationContext context)
12+
: base(context)
13+
{ }
14+
15+
public override void Migrate()
16+
{
17+
// Any user group which had access to the Developer section should have access to Packages
18+
Database.Execute($@"
19+
insert into {Constants.DatabaseSchema.Tables.UserGroup2App}
20+
select userGroupId, '{Constants.Applications.Packages}'
21+
from {Constants.DatabaseSchema.Tables.UserGroup2App}
22+
where app='developer'");
23+
}
24+
}
25+
}

src/Umbraco.Core/Umbraco.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
<Compile Include="Manifest\ManifestFilterCollectionBuilder.cs" />
257257
<Compile Include="Mapping\MapperContext.cs" />
258258
<Compile Include="Migrations\Upgrade\Common\DeleteKeysAndIndexes.cs" />
259+
<Compile Include="Migrations\Upgrade\V_8_0_0\AddPackagesSectionAccess.cs" />
259260
<Compile Include="Migrations\Upgrade\V_8_0_0\DataTypes\ContentPickerPreValueMigrator.cs" />
260261
<Compile Include="Migrations\Upgrade\V_8_0_0\DataTypes\DecimalPreValueMigrator.cs" />
261262
<Compile Include="Migrations\Upgrade\V_8_0_0\DataTypes\IPreValueMigrator.cs" />

0 commit comments

Comments
 (0)