Move constants
This commit is contained in:
@@ -35,39 +35,39 @@ namespace Umbraco.Core.Models
|
||||
|
||||
throw new InvalidCastException($"Cannot cast dataType configuration, of type {configuration.GetType().Name}, to {typeof(T).Name}.");
|
||||
}
|
||||
|
||||
|
||||
private static readonly ISet<Guid> IdsOfBuildInDataTypes = new HashSet<Guid>()
|
||||
{
|
||||
Constants.DataTypes.Guids.ContentPickerGuid,
|
||||
Constants.DataTypes.Guids.MemberPickerGuid,
|
||||
Constants.DataTypes.Guids.MediaPickerGuid,
|
||||
Constants.DataTypes.Guids.MultipleMediaPickerGuid,
|
||||
Constants.DataTypes.Guids.RelatedLinksGuid,
|
||||
Constants.DataTypes.Guids.MemberGuid,
|
||||
Constants.DataTypes.Guids.ImageCropperGuid,
|
||||
Constants.DataTypes.Guids.TagsGuid,
|
||||
Constants.DataTypes.Guids.ListViewContentGuid,
|
||||
Constants.DataTypes.Guids.ListViewMediaGuid,
|
||||
Constants.DataTypes.Guids.ListViewMembersGuid,
|
||||
Constants.DataTypes.Guids.DatePickerWithTimeGuid,
|
||||
Constants.DataTypes.Guids.ApprovedColorGuid,
|
||||
Constants.DataTypes.Guids.DropdownMultipleGuid,
|
||||
Constants.DataTypes.Guids.RadioboxGuid,
|
||||
Constants.DataTypes.Guids.DatePickerGuid,
|
||||
Constants.DataTypes.Guids.DropdownGuid,
|
||||
Constants.DataTypes.Guids.CheckboxListGuid,
|
||||
Constants.DataTypes.Guids.CheckboxGuid,
|
||||
Constants.DataTypes.Guids.NumericGuid,
|
||||
Constants.DataTypes.Guids.RichtextEditorGuid,
|
||||
Constants.DataTypes.Guids.TextstringGuid,
|
||||
Constants.DataTypes.Guids.TextareaGuid,
|
||||
Constants.DataTypes.Guids.UploadGuid,
|
||||
Constants.DataTypes.Guids.LabelStringGuid,
|
||||
Constants.DataTypes.Guids.LabelDecimalGuid,
|
||||
Constants.DataTypes.Guids.LabelDateTimeGuid,
|
||||
Constants.DataTypes.Guids.LabelBigIntGuid,
|
||||
Constants.DataTypes.Guids.LabelTimeGuid,
|
||||
Constants.DataTypes.Guids.LabelDateTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.ContentPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.MemberPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.MediaPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.MultipleMediaPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.RelatedLinksGuid,
|
||||
ConstantsCore.DataTypes.Guids.MemberGuid,
|
||||
ConstantsCore.DataTypes.Guids.ImageCropperGuid,
|
||||
ConstantsCore.DataTypes.Guids.TagsGuid,
|
||||
ConstantsCore.DataTypes.Guids.ListViewContentGuid,
|
||||
ConstantsCore.DataTypes.Guids.ListViewMediaGuid,
|
||||
ConstantsCore.DataTypes.Guids.ListViewMembersGuid,
|
||||
ConstantsCore.DataTypes.Guids.DatePickerWithTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.ApprovedColorGuid,
|
||||
ConstantsCore.DataTypes.Guids.DropdownMultipleGuid,
|
||||
ConstantsCore.DataTypes.Guids.RadioboxGuid,
|
||||
ConstantsCore.DataTypes.Guids.DatePickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.DropdownGuid,
|
||||
ConstantsCore.DataTypes.Guids.CheckboxListGuid,
|
||||
ConstantsCore.DataTypes.Guids.CheckboxGuid,
|
||||
ConstantsCore.DataTypes.Guids.NumericGuid,
|
||||
ConstantsCore.DataTypes.Guids.RichtextEditorGuid,
|
||||
ConstantsCore.DataTypes.Guids.TextstringGuid,
|
||||
ConstantsCore.DataTypes.Guids.TextareaGuid,
|
||||
ConstantsCore.DataTypes.Guids.UploadGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelStringGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelDecimalGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelDateTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelBigIntGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelDateTimeGuid,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace Umbraco.Core.Models
|
||||
|
||||
private static readonly Dictionary<Guid, Guid> ObjectTypeMap = new Dictionary<Guid, Guid>
|
||||
{
|
||||
{ Constants.ObjectTypes.DataType, Constants.ObjectTypes.DataTypeContainer },
|
||||
{ Constants.ObjectTypes.DocumentType, Constants.ObjectTypes.DocumentTypeContainer },
|
||||
{ Constants.ObjectTypes.MediaType, Constants.ObjectTypes.MediaTypeContainer }
|
||||
{ ConstantsCore.ObjectTypes.DataType, ConstantsCore.ObjectTypes.DataTypeContainer },
|
||||
{ ConstantsCore.ObjectTypes.DocumentType, ConstantsCore.ObjectTypes.DocumentTypeContainer },
|
||||
{ ConstantsCore.ObjectTypes.MediaType, ConstantsCore.ObjectTypes.MediaTypeContainer }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Umbraco.Core.Models.Identity
|
||||
|
||||
private static string GetPasswordHash(string storedPass)
|
||||
{
|
||||
return storedPass.StartsWith(Constants.Security.EmptyPasswordPrefix) ? null : storedPass;
|
||||
return storedPass.StartsWith(ConstantsCore.Security.EmptyPasswordPrefix) ? null : storedPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace Umbraco.Core.Models.Membership
|
||||
|
||||
private static bool IsSystemUserGroup(this string groupAlias)
|
||||
{
|
||||
return groupAlias == Constants.Security.AdminGroupAlias
|
||||
|| groupAlias == Constants.Security.SensitiveDataGroupAlias
|
||||
|| groupAlias == Constants.Security.TranslatorGroupAlias;
|
||||
return groupAlias == ConstantsCore.Security.AdminGroupAlias
|
||||
|| groupAlias == ConstantsCore.Security.SensitiveDataGroupAlias
|
||||
|| groupAlias == ConstantsCore.Security.TranslatorGroupAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,16 +102,16 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
// TODO: this list somehow also exists in constants, see memberTypeRepository => remove duplicate!
|
||||
private static readonly Dictionary<string, int> BuiltinMemberProperties = new Dictionary<string, int>
|
||||
{
|
||||
{ "Email", Constants.DataTypes.Textbox },
|
||||
{ "Username", Constants.DataTypes.Textbox },
|
||||
{ "PasswordQuestion", Constants.DataTypes.Textbox },
|
||||
{ "Comments", Constants.DataTypes.Textbox },
|
||||
{ "IsApproved", Constants.DataTypes.Boolean },
|
||||
{ "IsLockedOut", Constants.DataTypes.Boolean },
|
||||
{ "LastLockoutDate", Constants.DataTypes.DateTime },
|
||||
{ "CreateDate", Constants.DataTypes.DateTime },
|
||||
{ "LastLoginDate", Constants.DataTypes.DateTime },
|
||||
{ "LastPasswordChangeDate", Constants.DataTypes.DateTime },
|
||||
{ "Email", ConstantsCore.DataTypes.Textbox },
|
||||
{ "Username", ConstantsCore.DataTypes.Textbox },
|
||||
{ "PasswordQuestion", ConstantsCore.DataTypes.Textbox },
|
||||
{ "Comments", ConstantsCore.DataTypes.Textbox },
|
||||
{ "IsApproved", ConstantsCore.DataTypes.Boolean },
|
||||
{ "IsLockedOut", ConstantsCore.DataTypes.Boolean },
|
||||
{ "LastLockoutDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "CreateDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "LastLoginDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "LastPasswordChangeDate", ConstantsCore.DataTypes.DateTime },
|
||||
};
|
||||
|
||||
#region Content type
|
||||
|
||||
@@ -18,14 +18,14 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Root
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.SystemRoot)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.SystemRoot)]
|
||||
[FriendlyName("Root")]
|
||||
ROOT,
|
||||
|
||||
/// <summary>
|
||||
/// Document
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Document, typeof(IContent))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Document, typeof(IContent))]
|
||||
[FriendlyName("Document")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Document)]
|
||||
Document,
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Media
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Media, typeof(IMedia))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Media, typeof(IMedia))]
|
||||
[FriendlyName("Media")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Media)]
|
||||
Media,
|
||||
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Member Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MemberType, typeof(IMemberType))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MemberType, typeof(IMemberType))]
|
||||
[FriendlyName("Member Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MemberType)]
|
||||
MemberType,
|
||||
@@ -49,7 +49,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Template
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Template, typeof(ITemplate))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Template, typeof(ITemplate))]
|
||||
[FriendlyName("Template")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Template)]
|
||||
Template,
|
||||
@@ -57,7 +57,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Member Group
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MemberGroup)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MemberGroup)]
|
||||
[FriendlyName("Member Group")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MemberGroup)]
|
||||
MemberGroup,
|
||||
@@ -65,7 +65,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// "Media Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MediaType, typeof(IMediaType))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MediaType, typeof(IMediaType))]
|
||||
[FriendlyName("Media Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MediaType)]
|
||||
MediaType,
|
||||
@@ -73,7 +73,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Document Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DocumentType, typeof(IContentType))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DocumentType, typeof(IContentType))]
|
||||
[FriendlyName("Document Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DocumentType)]
|
||||
DocumentType,
|
||||
@@ -81,14 +81,14 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Recycle Bin
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.ContentRecycleBin)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.ContentRecycleBin)]
|
||||
[FriendlyName("Recycle Bin")]
|
||||
RecycleBin,
|
||||
|
||||
/// <summary>
|
||||
/// Stylesheet
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Stylesheet)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Stylesheet)]
|
||||
[FriendlyName("Stylesheet")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Stylesheet)]
|
||||
Stylesheet,
|
||||
@@ -96,7 +96,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Member
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Member, typeof(IMember))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Member, typeof(IMember))]
|
||||
[FriendlyName("Member")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Member)]
|
||||
Member,
|
||||
@@ -104,7 +104,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Data Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DataType, typeof(IDataType))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DataType, typeof(IDataType))]
|
||||
[FriendlyName("Data Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DataType)]
|
||||
DataType,
|
||||
@@ -112,7 +112,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Document type container
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DocumentTypeContainer)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DocumentTypeContainer)]
|
||||
[FriendlyName("Document Type Container")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DocumentTypeContainer)]
|
||||
DocumentTypeContainer,
|
||||
@@ -120,7 +120,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Media type container
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MediaTypeContainer)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MediaTypeContainer)]
|
||||
[FriendlyName("Media Type Container")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MediaTypeContainer)]
|
||||
MediaTypeContainer,
|
||||
@@ -128,7 +128,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Media type container
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DataTypeContainer)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DataTypeContainer)]
|
||||
[FriendlyName("Data Type Container")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DataTypeContainer)]
|
||||
DataTypeContainer,
|
||||
@@ -136,7 +136,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Relation type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.RelationType)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.RelationType)]
|
||||
[FriendlyName("Relation Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.RelationType)]
|
||||
RelationType,
|
||||
@@ -144,35 +144,35 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Forms Form
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.FormsForm)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.FormsForm)]
|
||||
[FriendlyName("Form")]
|
||||
FormsForm,
|
||||
|
||||
/// <summary>
|
||||
/// Forms PreValue
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.FormsPreValue)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.FormsPreValue)]
|
||||
[FriendlyName("PreValue")]
|
||||
FormsPreValue,
|
||||
|
||||
/// <summary>
|
||||
/// Forms DataSource
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.FormsDataSource)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.FormsDataSource)]
|
||||
[FriendlyName("DataSource")]
|
||||
FormsDataSource,
|
||||
|
||||
/// <summary>
|
||||
/// Language
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Language)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Language)]
|
||||
[FriendlyName("Language")]
|
||||
Language,
|
||||
|
||||
/// <summary>
|
||||
/// Document Blueprint
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DocumentBlueprint, typeof(IContent))]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DocumentBlueprint, typeof(IContent))]
|
||||
[FriendlyName("DocumentBlueprint")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DocumentBlueprint)]
|
||||
DocumentBlueprint,
|
||||
@@ -180,7 +180,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Reserved Identifier
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.IdReservation)]
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.IdReservation)]
|
||||
[FriendlyName("Identifier Reservation")]
|
||||
IdReservation
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Models
|
||||
public static bool IsSuper(this IUser user)
|
||||
{
|
||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||
return user.Id == Constants.Security.SuperUserId;
|
||||
return user.Id == ConstantsCore.Security.SuperUserId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Models
|
||||
public static bool IsAdmin(this IUser user)
|
||||
{
|
||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.AdminGroupAlias);
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == ConstantsCore.Security.AdminGroupAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -56,7 +56,7 @@ namespace Umbraco.Core.Models
|
||||
/// </returns>
|
||||
internal static string[] GetUserAvatarUrls(this IUser user, IAppCache cache)
|
||||
{
|
||||
// If FIPS is required, never check the Gravatar service as it only supports MD5 hashing.
|
||||
// If FIPS is required, never check the Gravatar service as it only supports MD5 hashing.
|
||||
// Unfortunately, if the FIPS setting is enabled on Windows, using MD5 will throw an exception
|
||||
// and the website will not run.
|
||||
// Also, check if the user has explicitly removed all avatars including a Gravatar, this will be possible and the value will be "none"
|
||||
@@ -151,46 +151,46 @@ namespace Umbraco.Core.Models
|
||||
|
||||
internal static bool HasContentRootAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RootString, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RootString, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasContentBinAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RecycleBinContentString, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RecycleBinContentString, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasMediaRootAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RootString, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RootString, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
internal static bool HasMediaBinAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RecycleBinMediaString, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RecycleBinMediaString, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
internal static bool HasPathAccess(this IUser user, IContent content, IEntityService entityService)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
return ContentPermissionsHelper.HasPathAccess(content.Path, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(content.Path, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasPathAccess(this IUser user, IMedia media, IEntityService entityService)
|
||||
{
|
||||
if (media == null) throw new ArgumentNullException(nameof(media));
|
||||
return ContentPermissionsHelper.HasPathAccess(media.Path, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(media.Path, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
internal static bool HasContentPathAccess(this IUser user, IUmbracoEntity entity, IEntityService entityService)
|
||||
{
|
||||
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasMediaPathAccess(this IUser user, IUmbracoEntity entity, IEntityService entityService)
|
||||
{
|
||||
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -200,7 +200,7 @@ namespace Umbraco.Core.Models
|
||||
public static bool HasAccessToSensitiveData(this IUser user)
|
||||
{
|
||||
if (user == null) throw new ArgumentNullException("user");
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.SensitiveDataGroupAlias);
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == ConstantsCore.Security.SensitiveDataGroupAlias);
|
||||
}
|
||||
|
||||
// calc. start nodes, combining groups' and user's, and excluding what's in the bin
|
||||
@@ -290,14 +290,14 @@ namespace Umbraco.Core.Models
|
||||
|
||||
private static string GetBinPath(UmbracoObjectTypes objectType)
|
||||
{
|
||||
var binPath = Constants.System.Root + ",";
|
||||
var binPath = ConstantsCore.System.Root + ",";
|
||||
switch (objectType)
|
||||
{
|
||||
case UmbracoObjectTypes.Document:
|
||||
binPath += Constants.System.RecycleBinContent;
|
||||
binPath += ConstantsCore.System.RecycleBinContent;
|
||||
break;
|
||||
case UmbracoObjectTypes.Media:
|
||||
binPath += Constants.System.RecycleBinMedia;
|
||||
binPath += ConstantsCore.System.RecycleBinMedia;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(objectType));
|
||||
@@ -314,7 +314,7 @@ namespace Umbraco.Core.Models
|
||||
? entityService.GetAllPaths(objectType, asn).ToDictionary(x => x.Id, x => x.Path)
|
||||
: new Dictionary<int, string>();
|
||||
|
||||
paths[Constants.System.Root] = Constants.System.RootString; // entityService does not get that one
|
||||
paths[ConstantsCore.System.Root] = ConstantsCore.System.RootString; // entityService does not get that one
|
||||
|
||||
var binPath = GetBinPath(objectType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user