Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublicAccessEntry

    Represents a public access entry that defines protection rules for a content node.

    Inheritance
    object
    BeingDirtyBase
    EntityBase
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(IsReference = true)]
    public class PublicAccessEntry : EntityBase, IRememberBeingDirty, ICanBeDirty, IEntity, IDeepCloneable
    Remarks

    Public access entries define which content nodes are protected, which node serves as the login page, which node is displayed when access is denied, and the rules that determine access permissions.

    Constructors

    View Source

    PublicAccessEntry(Guid, int, int, int, IEnumerable<PublicAccessRule>)

    Initializes a new instance of the PublicAccessEntry class with explicit identifiers.

    Declaration
    public PublicAccessEntry(Guid id, int protectedNodeId, int loginNodeId, int noAccessNodeId, IEnumerable<PublicAccessRule> ruleCollection)
    Parameters
    Type Name Description
    Guid id

    The unique identifier for this entry.

    int protectedNodeId

    The identifier of the protected content node.

    int loginNodeId

    The identifier of the login content node.

    int noAccessNodeId

    The identifier of the no-access content node.

    IEnumerable<PublicAccessRule> ruleCollection

    The collection of access rules.

    View Source

    PublicAccessEntry(IContent, IContent, IContent, IEnumerable<PublicAccessRule>)

    Initializes a new instance of the PublicAccessEntry class.

    Declaration
    public PublicAccessEntry(IContent protectedNode, IContent loginNode, IContent noAccessNode, IEnumerable<PublicAccessRule> ruleCollection)
    Parameters
    Type Name Description
    IContent protectedNode

    The content node to protect.

    IContent loginNode

    The content node to redirect to for login.

    IContent noAccessNode

    The content node to display when access is denied.

    IEnumerable<PublicAccessRule> ruleCollection

    The collection of access rules.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when any of the required parameters is null.

    Properties

    View Source

    LoginNodeId

    Gets or sets the identifier of the login content node.

    Declaration
    [DataMember]
    public int LoginNodeId { get; set; }
    Property Value
    Type Description
    int
    View Source

    NoAccessNodeId

    Gets or sets the identifier of the content node displayed when access is denied.

    Declaration
    [DataMember]
    public int NoAccessNodeId { get; set; }
    Property Value
    Type Description
    int
    View Source

    ProtectedNodeId

    Gets or sets the identifier of the protected content node.

    Declaration
    [DataMember]
    public int ProtectedNodeId { get; set; }
    Property Value
    Type Description
    int
    View Source

    RemovedRules

    Gets the keys of rules that have been removed from this entry.

    Declaration
    public IEnumerable<Guid> RemovedRules { get; }
    Property Value
    Type Description
    IEnumerable<Guid>
    View Source

    Rules

    Gets the collection of access rules for this entry.

    Declaration
    public IEnumerable<PublicAccessRule> Rules { get; }
    Property Value
    Type Description
    IEnumerable<PublicAccessRule>

    Methods

    View Source

    AddRule(string, string)

    Adds a new access rule to this entry.

    Declaration
    public PublicAccessRule AddRule(string ruleValue, string ruleType)
    Parameters
    Type Name Description
    string ruleValue

    The value of the rule (e.g., a member group name or username).

    string ruleType

    The type of the rule (e.g., "RoleName" or "Username").

    Returns
    Type Description
    PublicAccessRule

    The newly created access rule.

    View Source

    ClearRules()

    Removes all access rules from this entry.

    Declaration
    public void ClearRules()
    View Source

    PerformDeepClone(object)

    Used by inheritors to modify the DeepCloning logic

    Declaration
    protected override void PerformDeepClone(object clone)
    Parameters
    Type Name Description
    object clone
    View Source

    RemoveRule(PublicAccessRule)

    Removes an access rule from this entry.

    Declaration
    public void RemoveRule(PublicAccessRule rule)
    Parameters
    Type Name Description
    PublicAccessRule rule

    The rule to remove.

    View Source

    ResetDirtyProperties(bool)

    Resets dirty properties.

    Declaration
    public override void ResetDirtyProperties(bool rememberDirty)
    Parameters
    Type Name Description
    bool rememberDirty

    A value indicating whether to remember dirty properties.

    Remarks

    When rememberDirty is true, dirty properties are saved so they can be checked with WasDirty.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX