Search Results for

    Show / Hide Table of Contents

    Class RoleManager

    Manage all roles in the

    Inheritance
    System.Object
    RoleManager
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Framework.Core
    Assembly: Simplic.Framework.Base.dll
    Syntax
    public class RoleManager

    Properties

    | Improve this Doc View Source

    Singleton

    Singleton access to the role manager, because the class is not instanceable

    Declaration
    public static RoleManager Singleton { get; }
    Property Value
    Type Description
    RoleManager

    Methods

    | Improve this Doc View Source

    CreateRole(Role)

    Create a new role and save it in the database

    Declaration
    public Role CreateRole(Role role)
    Parameters
    Type Name Description
    Role role

    Instance of a role object

    Returns
    Type Description
    Role

    Saved role object, with a RoleId and ExportId if not set before

    | Improve this Doc View Source

    DeleteRole(Role)

    Delete a role from the database

    Declaration
    public void DeleteRole(Role role)
    Parameters
    Type Name Description
    Role role

    Role model isntance

    | Improve this Doc View Source

    DeleteRole(Guid)

    Delete a roler from the database

    Declaration
    public void DeleteRole(Guid role)
    Parameters
    Type Name Description
    System.Guid role
    | Improve this Doc View Source

    DeleteRoles(IList<Role>)

    Delete roles from the database

    Declaration
    public void DeleteRoles(IList<Role> roles)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<Role> roles

    Roles to delete

    | Improve this Doc View Source

    DeleteRoles(IList<Guid>)

    Delete roles from the database

    Declaration
    public void DeleteRoles(IList<Guid> roles)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<System.Guid> roles

    List of roles to delete

    | Improve this Doc View Source

    GetRole(Guid)

    Get a role from the database

    Declaration
    public Role GetRole(Guid roleId)
    Parameters
    Type Name Description
    System.Guid roleId

    Id of the role

    Returns
    Type Description
    Role

    Instance of a role model

    | Improve this Doc View Source

    GetRole(String)

    Get a role from the database

    Declaration
    public Role GetRole(string internName)
    Parameters
    Type Name Description
    System.String internName

    Get role by its intern name

    Returns
    Type Description
    Role

    Instance of a role model

    | Improve this Doc View Source

    ShowNewRoleEditor()

    Show the editor for adding new roles

    Declaration
    public void ShowNewRoleEditor()
    | Improve this Doc View Source

    ShowRoleEditor(IList<Guid>)

    Show the editor for editing a list of roles

    Declaration
    public void ShowRoleEditor(IList<Guid> roles)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<System.Guid> roles

    List of roles

    | Improve this Doc View Source

    UpdateRole(Role)

    Update a role in the database

    Declaration
    public void UpdateRole(Role role)
    Parameters
    Type Name Description
    Role role

    Instance of the role to update. The role must exists

    | Improve this Doc View Source

    UserHasRoleAccess(String, Int32)

    Proof whether the current user has access for a role. If no settings are assigned, the method will return false

    Declaration
    public bool UserHasRoleAccess(string roleName, int userId)
    Parameters
    Type Name Description
    System.String roleName

    Intern name of the role

    System.Int32 userId

    Id of the user

    Returns
    Type Description
    System.Boolean

    True if the access is allowed for the current user, false if not and also false if nothing is set.

    | Improve this Doc View Source

    UserHasRoleAccessWithDefault(String, Int32)

    Proof whether the current user has access for a role. If the method returns null, no settings are set.

    Declaration
    public bool? UserHasRoleAccessWithDefault(string roleName, int userId)
    Parameters
    Type Name Description
    System.String roleName

    Intern name of the role

    System.Int32 userId

    Id of the user

    Returns
    Type Description
    System.Nullable<System.Boolean>

    True if the access is allowed for the current user, false if not and null if for no one.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx