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.
Inherited Members
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 |