Interface ISecurity

The interface for Stonefield.Security.


public abstract interface ISecurity

Interface Members

MemberDescription

CreateSQLitePackage

Create a SQLite database of all security tables.

public void CreateSQLitePackage(string path)

GetCurrentUserAccess

Compares the current user's roles to the roles in the specified list of permissions and returns the maximum access level the user has or None if not found.

public AccessRights GetCurrentUserAccess(ObservableCollection<IPermission> permissions);

public AccessRights GetCurrentUserAccess(ObservableCollection<IPermission> permissions,
    AccessRights defaultAccess);

public AccessRights GetCurrentUserAccess(IList<IPermission> permissions);

public AccessRights GetCurrentUserAccess(IList<IPermission> permissions,
    AccessRights defaultAccess);

GetCurrentUserAccessToResource

Returns the access level the current user has for the specified resource.

public AccessRights GetCurrentUserAccessToResource(string resourceID,
    AccessRights defaultAccess);

public AccessRights GetCurrentUserAccessToResource(string resourceID,
    string resourceName,
    AccessRights defaultAccess);

GetLoggedInUsers

Returns a list of logged in users.

public IList<String> GetLoggedInUsers();

GetPermissionsForResource

Returns a collection of permission objects for the resource.

public ObservableCollection<IPermission> GetPermissionsForResource(string resourceID);

public IList<IPermission> GetPermissionsForResource(string resourceName,
    string resourceID,
    bool allRolesIfNone);

GetRoleAccessToResource

Returns the access level the passed-in role has for the specified resource.

public AccessRights GetRoleAccessToResource(string resourceID,
    Guid roleID,
    AccessRights defaultAccess);

IsCurrentUserInRole

Compares the current user's roles to the roles in the specified list and returns true if the user is in one of the roles.

public bool IsCurrentUserInRole(IList<IRole> roles);

Login

Attempts to log in the specified user.

public LoginResult Login(string userName,
    string password);

Logout

Logs the specified user out.

public void Logout(IUser user);

ReloadSecurity

Reloads security collections.

public void ReloadSecurity();

RemoveResourcePermission

Deletes a record in the Permissions table for the specified resource and role.

public void RemoveResourcePermission(string resourceID,
    IRole role);

SetResourcePermission

Updates or creates a record in the Permissions table for the specified resource and role.

public void SetResourcePermission(string resourceID,
    IRole role,
    AccessRights right);

public void SetResourcePermission(string resourceName,
    string resourceID,
    IRole role,
    AccessRights right);

AdministratorRole

The Administrator role.

CachePermissions

True to cache permissions for better performance; false is preferred in a network environment.

CurrentUser

A reference to the logged in user.

EveryoneRole

The Everyone role.

Provider

The provider used to connect to the security database.

Roles

A collection of roles.

TenantAdministratorRole

The TenantAdministratorRole role.

Tenants

A collection of tenants.

Users

A collection of users.

Requirements

Namespace: Stonefield.Security
Assembly: interfaces.dll