Simplifies the change password logic with the back office so an admin user can easily change another user's password if they have access to the users section. Updates the controllers to populate the modelstate correctly, changes name of HasAppAccess to HasSectionAccess. Ensure we don't have duplicate ysod dialogs when there is an error.

This commit is contained in:
Shannon
2017-09-04 22:03:03 +10:00
parent a0306f9d55
commit 7926a0c676
14 changed files with 76 additions and 37 deletions

View File

@@ -13,7 +13,13 @@ using Umbraco.Core.Services;
namespace Umbraco.Core.Models
{
public static class UserExtensions
{
{
public static bool HasSectionAccess(this IUser user, string app)
{
var apps = user.AllowedSections;
return apps.Any(uApp => uApp.InvariantEquals(app));
}
/// <summary>
/// Tries to lookup the user's gravatar to see if the endpoint can be reached, if so it returns the valid URL
/// </summary>