Show / Hide Table of Contents

Class WMOrganization

Implements organizations as instances of a WMPrincipal. Organizations can have access rights granted to them, which many be inherited by the WMUsers assigned to them.

Inheritance
object
WMPrincipal
WMOrganization
Implements
IDbEntity
IWMEntity
IPolicyAssignable
IWMAssetOwner
Inherited Members
WMPrincipal.ID
WMPrincipal.CreatedBy
WMPrincipal.CreatedDate
WMPrincipal.LastUpdatedBy
WMPrincipal.LastUpdatedDate
WMPrincipal.LoginName
WMPrincipal.Name
WMPrincipal.Password
WMPrincipal.Status
WMPrincipal.Get(string, string)
WMPrincipal.HashPassword(string, out string)
WMPrincipal.VerifyPassword(string, string, string)
WMPrincipal.Policies
WMPrincipal.Permissions
WMPrincipal.EnsureAuthorizedAsync<T>(WMAssetBaseDTO<T>)
WMPrincipal.EnsureAuthorizedAsync(WMAssetBase)
WMPrincipal.AuthorizedAsync(string, string)
WMPrincipal.Authorized(string, string)
WMPrincipal.AuthorizedAsync(string, string, string)
WMPrincipal.Authorized(string, string, string, string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Auth
Assembly: WMServer.dll
Syntax
public class WMOrganization : WMPrincipal, IDbEntity, IWMEntity, IPolicyAssignable, IWMAssetOwner

Constructors

WMOrganization()

Default constructor that sets the ID to a new GUID.

Declaration
public WMOrganization()

WMOrganization(string)

Constructor that initializes the ID.

Declaration
public WMOrganization(string id)
Parameters
Type Name Description
string id

Properties

Users

The users who have access to this organization. Populated manually.

Declaration
public List<WMUser> Users { get; set; }
Property Value
Type Description
List<WMUser>

Methods

AssociateUserRole(WMPrincipal, string, string, string, AuthDbContext)

Creates a JoinWMUserWMOrganization record joining the user and org with a role.

Declaration
public static Task AssociateUserRole(WMPrincipal principal, string org_ID, string user_ID, string role_name, AuthDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The user making this request

string org_ID

The ID of the organization

string user_ID

The ID of the user

string role_name

The name of the role

AuthDbContext context
Returns
Type Description
Task

Create(WMPrincipal, WMOrganizationArgs, AuthDbContext)

Updates the organization specified in the args parameter.

Declaration
public static Task<WMOrganization> Create(WMPrincipal principal, OrganizationController.WMOrganizationArgs args, AuthDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The user or organization

OrganizationController.WMOrganizationArgs args

The args specifying the organization to update, and what should be updated.

AuthDbContext context
Returns
Type Description
Task<WMOrganization>
Exceptions
Type Condition
Exception

Delete(WMPrincipal, string, AuthDbContext)

Deletes the organization with the specified ID.

Declaration
public static Task Delete(WMPrincipal principal, string ID, AuthDbContext context)
Parameters
Type Name Description
WMPrincipal principal
string ID
AuthDbContext context
Returns
Type Description
Task

DisassociateUser(WMPrincipal, string, string, AuthDbContext)

Deletes all JoinWMUserWMOrganization records joining the user and org.

Declaration
public static Task DisassociateUser(WMPrincipal principal, string org_ID, string user_ID, AuthDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The user making this request

string org_ID

The ID of the organization

string user_ID

The ID of the user

AuthDbContext context
Returns
Type Description
Task

DisassociateUserRole(WMPrincipal, string, string, string, AuthDbContext)

Deletes the JoinWMUserWMOrganization record joining the user, org, and role.

Declaration
public static Task DisassociateUserRole(WMPrincipal principal, string org_ID, string user_ID, string role_name, AuthDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The user making this request

string org_ID

The ID of the organization

string user_ID

The ID of the user

string role_name

The name of the role

AuthDbContext context
Returns
Type Description
Task

Get(WMPrincipal, AuthDbContext?)

Returns all organizations accessible by this principal.

Declaration
public static Task<IEnumerable<WMOrganizationDTO>> Get(WMPrincipal principal, AuthDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal

The user or organization.

AuthDbContext context
Returns
Type Description
Task<IEnumerable<WMOrganizationDTO>>

Get(WMPrincipal, string, AuthDbContext?)

Returns the WMOrganization with the specified ID if it exists, populates each WMUser with access to this organization.

Declaration
public static Task<WMOrganization> Get(WMPrincipal principal, string ID, AuthDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal

The user or organization.

string ID

The ID of the organization to retrieve.

AuthDbContext context
Returns
Type Description
Task<WMOrganization>

Get(string, AuthDbContext?)

Declaration
public static Task<WMOrganization> Get(string id, AuthDbContext? context = null)
Parameters
Type Name Description
string id
AuthDbContext context
Returns
Type Description
Task<WMOrganization>

Update(WMPrincipal, string, WMOrganizationArgs, AuthDbContext)

Create a new WMOrganization with the given args

Declaration
public static Task Update(WMPrincipal principal, string id, OrganizationController.WMOrganizationArgs args, AuthDbContext context)
Parameters
Type Name Description
WMPrincipal principal

The user or organization

string id
OrganizationController.WMOrganizationArgs args

The args to create a new organization from.

AuthDbContext context
Returns
Type Description
Task
Exceptions
Type Condition
Exception

Implements

IDbEntity
IWMEntity
IPolicyAssignable
IWMAssetOwner
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE