Files
Umbraco-CMS/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
Shannon Deminick 3792cafb9f Published members cleanup (#10159)
* Getting new netcore PublicAccessChecker in place

* Adds full test coverage for PublicAccessChecker

* remove PublicAccessComposer

* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller

* Implements the required methods on IMemberManager, removes old migrated code

* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops

* adds note

* adds note

* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.

* Changes name to IUmbracoEndpointBuilder

* adds note

* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect

* fixing build

* Updates user manager to correctly validate password hashing and injects the IBackOfficeUserPasswordChecker

* Merges PR

* Fixes up build and notes

* Implements security stamp and email confirmed for members, cleans up a bunch of repo/service level member groups stuff, shares user store code between members and users and fixes the user identity object so we arent' tracking both groups and roles.

* Security stamp for members is now working

* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.

* adds note

* removes unused filter, fixes build

* fixes WebPath and tests

* Looks up entities in one query

* remove usings

* Fix test, remove stylesheet

* Set status code before we write to response to avoid error

* Ensures that users and members are validated when logging in. Shares more code between users and members.

* merge changes

* oops

* Reducing and removing published member cache

* Fixes RepositoryCacheKeys to ensure the keys are normalized

* oops didn't mean to commit this

* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy

* oops didn't mean to comit this

* bah, far out this keeps getting recommitted. sorry

* cannot inject IPublishedMemberCache and cannot have IPublishedMember

* splits out files, fixes build

* fix tests

* removes membership provider classes

* removes membership provider classes

* updates the identity map definition

* reverts commented out lines

* reverts commented out lines

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-22 13:21:43 +02:00

151 lines
5.6 KiB
C#

using System;
using System.Collections.Generic;
namespace Umbraco.Cms.Core.Models.PublishedContent
{
/// <inheritdoc />
/// <summary>
/// Represents a published content item.
/// </summary>
/// <remarks>
/// <para>Can be a published document, media or member.</para>
/// </remarks>
public interface IPublishedContent : IPublishedElement
{
#region Content
// TODO: IPublishedContent properties colliding with models
// we need to find a way to remove as much clutter as possible from IPublishedContent,
// since this is preventing someone from creating a property named 'Path' and have it
// in a model, for instance. we could move them all under one unique property eg
// Infos, so we would do .Infos.SortOrder - just an idea - not going to do it in v8
/// <summary>
/// Gets the unique identifier of the content item.
/// </summary>
int Id { get; }
/// <summary>
/// Gets the name of the content item for the current culture.
/// </summary>
string Name { get; }
/// <summary>
/// Gets the URL segment of the content item for the current culture.
/// </summary>
string UrlSegment { get; }
/// <summary>
/// Gets the sort order of the content item.
/// </summary>
int SortOrder { get; }
/// <summary>
/// Gets the tree level of the content item.
/// </summary>
int Level { get; }
/// <summary>
/// Gets the tree path of the content item.
/// </summary>
string Path { get; }
/// <summary>
/// Gets the identifier of the template to use to render the content item.
/// </summary>
int? TemplateId { get; }
/// <summary>
/// Gets the identifier of the user who created the content item.
/// </summary>
int CreatorId { get; }
/// <summary>
/// Gets the date the content item was created.
/// </summary>
DateTime CreateDate { get; }
/// <summary>
/// Gets the identifier of the user who last updated the content item.
/// </summary>
int WriterId { get; }
/// <summary>
/// Gets the date the content item was last updated.
/// </summary>
/// <remarks>
/// <para>For published content items, this is also the date the item was published.</para>
/// <para>This date is always global to the content item, see CultureDate() for the
/// date each culture was published.</para>
/// </remarks>
DateTime UpdateDate { get; }
/// <summary>
/// Gets available culture infos.
/// </summary>
/// <remarks>
/// <para>Contains only those culture that are available. For a published content, these are
/// the cultures that are published. For a draft content, those that are 'available' ie
/// have a non-empty content name.</para>
/// <para>Does not contain the invariant culture.</para> // fixme?
/// </remarks>
IReadOnlyDictionary<string, PublishedCultureInfo> Cultures { get; }
/// <summary>
/// Gets the type of the content item (document, media...).
/// </summary>
PublishedItemType ItemType { get; }
/// <summary>
/// Gets a value indicating whether the content is draft.
/// </summary>
/// <remarks>
/// <para>A content is draft when it is the unpublished version of a content, which may
/// have a published version, or not.</para>
/// <para>When retrieving documents from cache in non-preview mode, IsDraft is always false,
/// as only published documents are returned. When retrieving in preview mode, IsDraft can
/// either be true (document is not published, or has been edited, and what is returned
/// is the edited version) or false (document is published, and has not been edited, and
/// what is returned is the published version).</para>
/// </remarks>
bool IsDraft(string culture = null);
/// <summary>
/// Gets a value indicating whether the content is published.
/// </summary>
/// <remarks>
/// <para>A content is published when it has a published version.</para>
/// <para>When retrieving documents from cache in non-preview mode, IsPublished is always
/// true, as only published documents are returned. When retrieving in draft mode, IsPublished
/// can either be true (document has a published version) or false (document has no
/// published version).</para>
/// <para>It is therefore possible for both IsDraft and IsPublished to be true at the same
/// time, meaning that the content is the draft version, and a published version exists.</para>
/// </remarks>
bool IsPublished(string culture = null);
#endregion
#region Tree
/// <summary>
/// Gets the parent of the content item.
/// </summary>
/// <remarks>The parent of root content is <c>null</c>.</remarks>
IPublishedContent Parent { get; }
/// <summary>
/// Gets the children of the content item that are available for the current culture.
/// </summary>
IEnumerable<IPublishedContent> Children { get; }
/// <summary>
/// Gets all the children of the content item, regardless of whether they are available for the current culture.
/// </summary>
IEnumerable<IPublishedContent> ChildrenForAllCultures { get; }
#endregion
}
}