Show / Hide Table of Contents

    Class SecuritySession

    Security session base class

    Inheritance
    Object
    SecuritySession
    Namespace: XData.Security
    Assembly: XData.Security.docfx.dll
    Syntax
    public abstract class SecuritySession : ISecuritySession

    Constructors

    | Improve this Doc View Source

    SecuritySession(String, String[], Boolean)

    Security session constructor

    Declaration
    public SecuritySession(string userName, string[] roles, bool isSupervisor = false)
    Parameters
    Type Name Description
    String userName

    User name

    String[] roles

    User roles

    Boolean isSupervisor

    Supervisor flag

    Properties

    | Improve this Doc View Source

    IsSupervisor

    Current user is supervisor flag

    Declaration
    public bool IsSupervisor { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Roles

    Current user roles list

    Declaration
    public string[] Roles { get; protected set; }
    Property Value
    Type Description
    String[]
    | Improve this Doc View Source

    UserName

    Current user name

    Declaration
    public string UserName { get; protected set; }
    Property Value
    Type Description
    String

    Methods

    | Improve this Doc View Source

    Action<T>(Expression<Func<CustomLogic<T>>>)

    Custom action name access helper

    Declaration
    protected static string Action<T>(Expression<Func<CustomLogic<T>>> expr)
        where T : class, IDataObject, new()
    Parameters
    Type Name Description
    Expression<Func<CustomLogic<T>>> expr

    Custom logic expression

    Returns
    Type Description
    String

    Custom action name

    Type Parameters
    Name Description
    T

    Data object type

    | Improve this Doc View Source

    FilterGrantedObjects<T>(String, Expression)

    Converts initial IQueryable expression filtering granted objects only

    Declaration
    public Expression FilterGrantedObjects<T>(string context, Expression allDataExpr)
        where T : class, IDataObject, new()
    Parameters
    Type Name Description
    String context

    Context name

    Expression allDataExpr

    Initial IQueryable expression

    Returns
    Type Description
    Expression

    Modified IQueryable expression

    Type Parameters
    Name Description
    T

    Data object type

    | Improve this Doc View Source

    GetGrantedActions<T>(String)

    Returns list of granted actions for current user

    Declaration
    public string[] GetGrantedActions<T>(string context = null)
        where T : class, IDataObject, new()
    Parameters
    Type Name Description
    String context

    Context name

    Returns
    Type Description
    String[]

    Actions list

    Type Parameters
    Name Description
    T

    Data object type

    | Improve this Doc View Source

    GetRestrictedProperties<T>(String)

    Returns list of restricted properties for current user

    Declaration
    public string[] GetRestrictedProperties<T>(string context = null)
        where T : class, IDataObject, new()
    Parameters
    Type Name Description
    String context

    Context name

    Returns
    Type Description
    String[]

    Properties name list

    Type Parameters
    Name Description
    T

    Data object type

    | Improve this Doc View Source

    InitializeSession()

    Session initialization

    Declaration
    protected abstract void InitializeSession()
    See Also
    RegisterGrantedActions(String, Type, IEnumerable<KeyValuePair<String, String[]>>)
    RegisterRestrictedProperties(String, Type, IEnumerable<KeyValuePair<String, String[]>>)
    RegisterSecurityFilters(String, Type, IEnumerable<KeyValuePair<String, Expression>>)
    | Improve this Doc View Source

    Property<T>(Expression<Func<T, Object>>)

    Property name access helper

    Declaration
    protected static string Property<T>(Expression<Func<T, object>> expr)
        where T : class, IDataObject, new()
    Parameters
    Type Name Description
    Expression<Func<T, Object>> expr

    Property expression

    Returns
    Type Description
    String

    Property name

    Type Parameters
    Name Description
    T

    Data object type

    | Improve this Doc View Source

    RegisterGrantedActions(String, Type, IEnumerable<KeyValuePair<String, String[]>>)

    Granted actions registration

    Declaration
    protected void RegisterGrantedActions(string context, Type type, IEnumerable<KeyValuePair<string, string[]>> actions)
    Parameters
    Type Name Description
    String context

    Context name

    Type type

    Data type to grant actions

    IEnumerable<KeyValuePair<String, String[]>> actions

    Granted actions

    | Improve this Doc View Source

    RegisterRestrictedProperties(String, Type, IEnumerable<KeyValuePair<String, String[]>>)

    Restricted properties registration

    Declaration
    protected void RegisterRestrictedProperties(string context, Type type, IEnumerable<KeyValuePair<string, string[]>> restricted)
    Parameters
    Type Name Description
    String context

    Context name

    Type type

    Data type to restrict property access

    IEnumerable<KeyValuePair<String, String[]>> restricted

    Restricted properties

    | Improve this Doc View Source

    RegisterSecurityFilters(String, Type, IEnumerable<KeyValuePair<String, Expression>>)

    Security filters registration

    Declaration
    protected void RegisterSecurityFilters(string context, Type type, IEnumerable<KeyValuePair<string, Expression>> filters)
    Parameters
    Type Name Description
    String context

    Context name

    Type type

    Data type to filter data

    IEnumerable<KeyValuePair<String, Expression>> filters

    Security filters

    Extension Methods

    SerializationExtensions.ToXml<T>(T)
    CollectionsExtensions.SetValue<TKey, T>(TKey, T)
    CollectionsExtensions.AsEnum<T>(T)
    DataObjectQueryableExtensions.CompareVariable(Object, FilterOperation, String)
    Processing.Do<T>(T, Action<IProcess<T>>[])
    TypeExtensions.TryConvert<T, TResult>(T, Func<T, TResult>)
    TypeExtensions.TryConvert<T, TResult>(T, Func<T, TResult>, TResult)
    TypeExtensions.ChangeType<T>(Object)
    TypeExtensions.ChangeType(Object, Type)
    TypeExtensions.InvokeMethod<TRet>(Object, Type[], Expression<Func<TRet>>, BindingFlags)
    TypeExtensions.InvokeMethod(Object, Type[], Expression<Action>, BindingFlags)
    TypeExtensions.InvokeMethod<TRet>(Object, Expression<Func<TRet>>, BindingFlags)
    TypeExtensions.InvokeMethod(Object, Expression<Action>, BindingFlags)
    SqlBlockExtensions.SetExpression<TTag, TResult>(TTag, Expression<Func<IBlockQueryAdapter, TResult>>)
    QueryDescriptionExtensions.SetExpression<TTag, TResult>(TTag, Expression<Func<IQueryStructureAdapter, TResult>>)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX