Skip to content

Commit 675e9ab

Browse files
committed
Merge branch 'v15/dev' into v15/bugfix/offline-notifcation
2 parents 633cce5 + f2b337a commit 675e9ab

File tree

105 files changed

+1356
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1356
-363
lines changed

src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentControllerBase.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,18 @@ protected UpdateDocumentControllerBase(IAuthorizationService authorizationServic
1717

1818
protected async Task<IActionResult> HandleRequest(Guid id, UpdateDocumentRequestModel requestModel, Func<Task<IActionResult>> authorizedHandler)
1919
{
20-
// TODO This have temporarily been uncommented, to support the client sends values from all cultures, even when the user do not have access to the languages.
21-
// The values are ignored in the ContentEditingService
20+
// We intentionally don't pass in cultures here.
21+
// This is to support the client sending values for all cultures even if the user doesn't have access to the language.
22+
// Values for unauthorized languages are later ignored in the ContentEditingService.
23+
AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
24+
User,
25+
ContentPermissionResource.WithKeys(ActionUpdate.ActionLetter, id),
26+
AuthorizationPolicies.ContentPermissionByResource);
2227

23-
// IEnumerable<string> cultures = requestModel.Variants
24-
// .Where(v => v.Culture is not null)
25-
// .Select(v => v.Culture!);
26-
// AuthorizationResult authorizationResult = await _authorizationService.AuthorizeResourceAsync(
27-
// User,
28-
// ContentPermissionResource.WithKeys(ActionUpdate.ActionLetter, id, cultures),
29-
// AuthorizationPolicies.ContentPermissionByResource);
30-
//
31-
// if (!authorizationResult.Succeeded)
32-
// {
33-
// return Forbidden();
34-
// }
28+
if (authorizationResult.Succeeded is false)
29+
{
30+
return Forbidden();
31+
}
3532

3633
return await authorizedHandler();
3734
}

src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ public async Task<CurrenUserConfigurationResponseModel> CreateCurrentUserConfigu
143143
KeepUserLoggedIn = _securitySettings.KeepUserLoggedIn,
144144
UsernameIsEmail = _securitySettings.UsernameIsEmail,
145145
PasswordConfiguration = _passwordConfigurationPresentationFactory.CreatePasswordConfigurationResponseModel(),
146+
147+
// You should not be able to change any password or set 2fa if any providers has deny local login set.
148+
AllowChangePassword = _externalLoginProviders.HasDenyLocalLogin() is false,
149+
AllowTwoFactor = _externalLoginProviders.HasDenyLocalLogin() is false,
146150
};
147151

148152
return await Task.FromResult(model);

src/Umbraco.Cms.Api.Management/OpenApi.json

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35929,6 +35929,8 @@
3592935929
},
3593035930
"CurrenUserConfigurationResponseModel": {
3593135931
"required": [
35932+
"allowChangePassword",
35933+
"allowTwoFactor",
3593235934
"keepUserLoggedIn",
3593335935
"passwordConfiguration",
3593435936
"usernameIsEmail"
@@ -35948,6 +35950,12 @@
3594835950
"$ref": "#/components/schemas/PasswordConfigurationResponseModel"
3594935951
}
3595035952
]
35953+
},
35954+
"allowChangePassword": {
35955+
"type": "boolean"
35956+
},
35957+
"allowTwoFactor": {
35958+
"type": "boolean"
3595135959
}
3595235960
},
3595335961
"additionalProperties": false
@@ -35970,14 +35978,11 @@
3597035978
"mediaStartNodeIds",
3597135979
"name",
3597235980
"permissions",
35981+
"userGroupIds",
3597335982
"userName"
3597435983
],
3597535984
"type": "object",
3597635985
"properties": {
35977-
"id": {
35978-
"type": "string",
35979-
"format": "uuid"
35980-
},
3598135986
"email": {
3598235987
"type": "string"
3598335988
},
@@ -35987,6 +35992,21 @@
3598735992
"name": {
3598835993
"type": "string"
3598935994
},
35995+
"userGroupIds": {
35996+
"uniqueItems": true,
35997+
"type": "array",
35998+
"items": {
35999+
"oneOf": [
36000+
{
36001+
"$ref": "#/components/schemas/ReferenceByIdModel"
36002+
}
36003+
]
36004+
}
36005+
},
36006+
"id": {
36007+
"type": "string",
36008+
"format": "uuid"
36009+
},
3599036010
"languageIsoCode": {
3599136011
"type": "string",
3599236012
"nullable": true
@@ -37786,6 +37806,16 @@
3778637806
"type": "string",
3778737807
"format": "date-time",
3778837808
"nullable": true
37809+
},
37810+
"scheduledPublishDate": {
37811+
"type": "string",
37812+
"format": "date-time",
37813+
"nullable": true
37814+
},
37815+
"scheduledUnpublishDate": {
37816+
"type": "string",
37817+
"format": "date-time",
37818+
"nullable": true
3778937819
}
3779037820
},
3779137821
"additionalProperties": false
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using Umbraco.Cms.Api.Management.ViewModels.Security;
1+
using Umbraco.Cms.Api.Management.ViewModels.Security;
22

33
namespace Umbraco.Cms.Api.Management.ViewModels.User.Current;
44

5+
// TODO (V16): Correct the spelling on this class name, it should be CurrentUserConfigurationResponseModel.
56
public class CurrenUserConfigurationResponseModel
67
{
78
public bool KeepUserLoggedIn { get; set; }
@@ -10,4 +11,8 @@ public class CurrenUserConfigurationResponseModel
1011
public bool UsernameIsEmail { get; set; }
1112

1213
public required PasswordConfigurationResponseModel PasswordConfiguration { get; set; }
14+
15+
public bool AllowChangePassword { get; set; }
16+
17+
public bool AllowTwoFactor { get; set; }
1318
}

src/Umbraco.Core/Routing/NewDefaultUrlProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public virtual IEnumerable<UrlInfo> GetOtherUrls(int id, Uri current)
117117

118118
// although we are passing in culture here, if any node in this path is invariant, it ignores the culture anyways so this is ok
119119
var route = GetLegacyRouteFormatById(key, culture);
120-
if (route == null)
120+
if (route == null || route == "#")
121121
{
122122
continue;
123123
}

src/Umbraco.Web.UI.Client/src/assets/lang/da-dk.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,14 @@ export default {
536536
linkToMedia: 'Link til medie',
537537
selectContentStartNode: 'Vælg startnode for indhold',
538538
selectMedia: 'Vælg medie',
539+
chooseMedia: 'Vælg medie',
540+
chooseMediaStartNode: 'Vælg startnode for medie',
539541
selectMediaType: 'Vælg medietype',
540542
selectIcon: 'Vælg ikon',
541543
selectItem: 'Vælg item',
542544
selectLink: 'Vælg link',
545+
addLink: 'Tilføj Link',
546+
updateLink: 'Opdater Link',
543547
selectMacro: 'Vælg makro',
544548
selectContent: 'Vælg indhold',
545549
selectContentType: 'Vælg indholdstype',

src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,13 @@ export default {
568568
linkToMedia: 'Link to media',
569569
selectContentStartNode: 'Select content start node',
570570
selectMedia: 'Select media',
571+
chooseMediaStartNode: 'Choose Media Start nodes',
571572
selectMediaType: 'Select media type',
572573
selectIcon: 'Select icon',
573574
selectItem: 'Select item',
574575
selectLink: 'Configure link',
576+
addLink: 'Add Link',
577+
updateLink: 'Update Link',
575578
selectMacro: 'Select macro',
576579
selectContent: 'Select content',
577580
selectContentType: 'Select content type',

src/Umbraco.Web.UI.Client/src/assets/lang/en.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,14 @@ export default {
559559
selectContentStartNode: 'Select content start node',
560560
selectEvent: 'Select event',
561561
selectMedia: 'Select media',
562+
chooseMedia: 'Choose media',
563+
chooseMediaStartNode: 'Choose Media Start nodes',
562564
selectMediaType: 'Select media type',
563565
selectIcon: 'Select icon',
564566
selectItem: 'Select item',
565567
selectLink: 'Configure link',
568+
addLink: 'Add Link',
569+
updateLink: 'Update Link',
566570
selectMacro: 'Select macro',
567571
selectContent: 'Select content',
568572
selectContentType: 'Select content type',

src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ export type CurrenUserConfigurationResponseModel = {
470470
*/
471471
usernameIsEmail: boolean;
472472
passwordConfiguration: (PasswordConfigurationResponseModel);
473+
allowChangePassword: boolean;
474+
allowTwoFactor: boolean;
473475
};
474476

475477
export type DatabaseInstallRequestModel = {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Node, mergeAttributes } from '@tiptap/core';
2+
3+
export interface DivOptions {
4+
/**
5+
* HTML attributes to add to the element.
6+
* @default {}
7+
* @example { class: 'foo' }
8+
*/
9+
HTMLAttributes: Record<string, any>;
10+
}
11+
12+
export const Div = Node.create<DivOptions>({
13+
name: 'div',
14+
15+
priority: 50,
16+
17+
group: 'block',
18+
19+
content: 'inline*',
20+
21+
addOptions() {
22+
return { HTMLAttributes: {} };
23+
},
24+
25+
parseHTML() {
26+
return [{ tag: 'div' }];
27+
},
28+
29+
renderHTML({ HTMLAttributes }) {
30+
return ['div', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
31+
},
32+
});

0 commit comments

Comments
 (0)