Search Results for

    Show / Hide Table of Contents

    Class BaseEntityWithPermissions

    Every entity that requires its own permissions must implement IBaseEntityWithPermissions

    You don't have to inherit from this class necessarily, you can implement your own base class

    This does contain some static helper functions for working with permissions

    Inheritance
    System.Object
    BaseEntity
    BaseEntityWithPermissions
    Implements
    IBaseEntityWithPermissions
    IBaseEntity
    System.IEquatable<IBaseEntity>
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.INotifyPropertyChanging
    ICloneableAsync
    ICanTrackProperties
    Inherited Members
    BaseEntity.HISTORY_ENDROWUPDATE_COLNAME
    BaseEntity.HasTrackedPropertyChanged(String)
    BaseEntity.OriginalTrackedPropertyValue(String)
    BaseEntity.OriginalTrackedPropertyValue<T>(String)
    BaseEntity.ClearTrackedOriginalValues()
    BaseEntity.GetAllOriginalTrackedPropertyValues()
    BaseEntity.ResetChangedTrackedPropertiesToOriginalValues()
    BaseEntity.AddTrackedOriginalValue(String, Object)
    BaseEntity.TrackChanges
    BaseEntity.SnapshotProperties()
    BaseEntity.RestoreFromSnapshot(Dictionary<String, Object>)
    BaseEntity.PropertyChanged
    BaseEntity.PropertyChanging
    BaseEntity.IsBasePropertyName(String)
    BaseEntity.IsBaseRelationshipID(String)
    BaseEntity.GetLabel(String)
    BaseEntity.SetLabel(String, String)
    BaseEntity.SetSilentLabel(String, String)
    BaseEntity.OnPropertyChanging(String)
    BaseEntity.OnPropertyChanged(String)
    BaseEntity.AccountID
    BaseEntity.ID
    BaseEntity.LastUpdated
    BaseEntity.ModifiedByUserID
    BaseEntity.ModifiedByUserID_Label
    BaseEntity.CanvasID
    BaseEntity.CanvasID_Label
    BaseEntity.Equals(IBaseEntity)
    BaseEntity.GetHashCode()
    BaseEntity.Equals(Object)
    BaseEntity.CopyFromEntity(IBaseEntity)
    BaseEntity.Clone(Object)
    BaseEntity.CopyFromSource(Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.API.Core
    Assembly: API.dll
    Syntax
    [DataContract]
    public abstract class BaseEntityWithPermissions : BaseEntity, IBaseEntityWithPermissions, IBaseEntity, IEquatable<IBaseEntity>, INotifyPropertyChanged, INotifyPropertyChanging, ICloneableAsync, ICanTrackProperties

    Methods

    CanChangeItemPermissions(Object, IEntityRetriever, IReadOnlyCache, Guid)

    Returns a task that indicates if the specifed team has permissions to change permissions for the specified item

    This works by first checking if the item itself inherits from IBaseEntityWithPermissions. If it does it checks if the item has an individual permission for the team, or the general permissions for the item type as a whole and then ensures they have permissions to change permissions.

    If the item does not inherit IBaseEntityWithPermissions then it recursively checks relationships that are marked as inheriting permissions to ensure all those items have the required permissions

    Otherwise the item is not permissioned by lemonedge and is just assumed to have full access

    Declaration
    public static Task<bool> CanChangeItemPermissions(object item, IEntityRetriever con, IReadOnlyCache cache, Guid teamID)
    Parameters
    Type Name Description
    System.Object item

    The item to check if the team has permissions to change permissions

    IEntityRetriever con

    A context to use to check for permissions if needed

    IReadOnlyCache cache

    The local cache to check cached permissions of if required

    System.Guid teamID

    The team to check permissions of

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    A task that indicates if the specifed team has permissions to change permissions for the specified item

    CanDeleteItem(Object, IEntityRetriever, IReadOnlyCache, Guid)

    Returns a task that indicates if the specifed team has permissions to delete the specified item

    This works by first checking if the item itself inherits from IBaseEntityWithPermissions. If it does it checks if the item has an individual permission for the team, or the general permissions for the item type as a whole and then ensures they are delete or greater.

    If the item does not inherit IBaseEntityWithPermissions then it recursively checks relationships that are marked as inheriting permissions to ensure all those items have the required permissions

    Otherwise the item is not permissioned by lemonedge and is just assumed to have full access

    Declaration
    public static Task<bool> CanDeleteItem(object item, IEntityRetriever con, IReadOnlyCache cache, Guid teamID)
    Parameters
    Type Name Description
    System.Object item

    The item to check if the team has permissions to delete

    IEntityRetriever con

    A context to use to check for permissions if needed

    IReadOnlyCache cache

    The local cache to check cached permissions of if required

    System.Guid teamID

    The team to check permissions of

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    A task that indicates if the specifed team has permissions to delete the specified item

    CanWriteItem(Object, IEntityRetriever, IReadOnlyCache, Guid)

    Returns a task that indicates if the specifed team has permissions to edit the specified item

    This works by first checking if the item itself inherits from IBaseEntityWithPermissions. If it does it checks if the item has an individual permission for the team, or the general permissions for the item type as a whole and then ensures they are read-write or greater.

    If the item does not inherit IBaseEntityWithPermissions then it recursively checks relationships that are marked as inheriting permissions to ensure all those items have the required permissions

    Otherwise the item is not permissioned by lemonedge and is just assumed to have full access

    Declaration
    public static Task<bool> CanWriteItem(object item, IEntityRetriever con, IReadOnlyCache cache, Guid teamID)
    Parameters
    Type Name Description
    System.Object item

    The item to check if the team has permissions to edit

    IEntityRetriever con

    A context to use to check for permissions if needed

    IReadOnlyCache cache

    The local cache to check cached permissions of if required

    System.Guid teamID

    The team to check permissions of

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>

    A task that indicates if the specifed team has permissions to edit the specified item

    IsLocked(Object)

    Indicates if this item implements ICanBeLocked and is set to Locked

    Declaration
    public static bool IsLocked(object item)
    Parameters
    Type Name Description
    System.Object item

    An item to check to see if it is locked

    Returns
    Type Description
    System.Boolean

    True if this item implements ICanBeLocked and is set to Locked

    Implements

    IBaseEntityWithPermissions
    IBaseEntity
    System.IEquatable<T>
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.INotifyPropertyChanging
    ICloneableAsync
    ICanTrackProperties

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)

    See Also

    IBaseEntityWithPermissions
    In This Article
    Back to top © LemonEdge Technology. All rights reserved.