Class OrganizationSystem
Defined in File OrganizationSystem.h
Inheritance Relationships
Base Type
public csp::systems::SystemBase
(Class SystemBase)
Class Documentation
-
class OrganizationSystem : public csp::systems::SystemBase
Public facing system that allows interfacing with the Organization System.
Public Types
-
typedef std::function<void(csp::common::String)> MemberJoinedOrganizationCallback
Callback that will be fired when a new member joins an Organization.
Event will be received by member who joined Organization and the Organization Admin/Owner.
- Param csp::Common::String
: Id of the new member.
Public Functions
-
~OrganizationSystem()
-
void SetMemberJoinedOrganizationCallback(MemberJoinedOrganizationCallback Callback)
Sets a callback to be executed when a member joins an Organization.
Only one callback may be registered, calling this function again will override whatever was previously set.
- Parameters
Callback – MemberJoinedOrganizationCallback : the callback to execute.
-
void CreateOrganization(const csp::common::String &OrganizationOwnerId, const csp::common::String &OrganizationName, OrganizationResultCallback Callback)
Create a new Organization.
Only a User with tenant admin permissions can create an Organization. If the user does not have the required permissions their call will be rejected.
- Parameters
OrganizationOwnerId – csp::common::Optional<csp::common::String> : Id of the Organization owner.
OrganizationName – csp::common::String : The Organization name
Callback – OrganizationResultCallback : Callback when asynchronous task finishes.
-
void GetOrganization(const csp::common::Optional<csp::common::String> &OrganizationId, OrganizationResultCallback Callback)
Retrieves Organization info for the specified Organization.
If this request is made by a User with an Owner or Admin Organization role, the resultant Organization object will contain an array of OrganizationRoleInfo objects for each Organization member. If the request is made by a User who does not have the Owner or Admin role, the resultant Organization object will contain an array with a single OrganizationRoleInfo object which represents them.
- Parameters
OrganizationId – csp::common::Optional<csp::common::String> : Id of the Organization to retrieve information on. If no Id is specified, the Id of the Organization the user is currently authenticated against will be used.
Callback – OrganizationResultCallback : Callback when asynchronous task finishes.
-
const csp::common::String &GetCurrentOrganizationId() const
Get the Id of the Organization the user is authenticated against.
- Returns
The Id of the Organization the User belongs to.
-
void UpdateOrganization(const csp::common::Optional<csp::common::String> &OrganizationId, const csp::common::String &Name, OrganizationResultCallback Callback)
Updates the name and/or the description of the specified Organization.
Only a User with an Organization Owner role can update an Organization. If the user does not have the required Organization role their call will be rejected.
- Parameters
OrganizationId – csp::common::Optional<csp::common::String> : Id of the Organization to update. If no Id is specified, the Id of the Organization the user is currently authenticated against will be used.
Name – csp::common::String : The new Organization name
Callback – OrganizationResultCallback : Callback when asynchronous task finishes.
-
void DeactivateOrganization(const csp::common::String &OrganizationId, NullResultCallback Callback)
Deactivates the specified Organization.
This call performs a soft-delete of the Organization and will allow for Organization reactivation in the future. Only A User with owner-level permissions can deactivate an Organization. If the user does not have the required role their call will be rejected.
- Parameters
OrganizationId – csp::common::String : Id of the Organization to deactivate.
Callback – NullResultCallback : Callback when asynchronous task finishes.
-
void InviteToOrganization(const csp::common::Optional<csp::common::String> &OrganizationId, const csp::common::String &Email, const csp::common::Array<EOrganizationRole> &OrganizationRoles, const csp::common::Optional<csp::common::String> &EmailLinkUrl, const csp::common::Optional<csp::common::String> &SignupUrl, NullResultCallback Callback)
Invites a given email to the User’s Organization.
Only a User with an Admin or Owner Organization role can invite people to the organization. If the User does not have the required role their call will be rejected.
- Parameters
OrganizationId – csp::common::Optional<csp::common::String> : Id of the Organization the user should be added to. If no Id is specified, the Id of the Organization the user is currently authenticated against will be used.
Email – csp::common::String : Email to invite to the Organization.
OrganizationRoles – csp::common::Array<EOrganizationRole> : The role/s in the Organization the invited User is to have.
EmailLinkUrl – csp::common::Optional<csp::common::String> : link that will be provided in the invite email
SignupUrl – csp::common::Optional<csp::common::String> : destination link that will be provided in the invite email
Callback – NullResultCallback : Callback when asynchronous task finishes.
-
void BulkInviteToOrganization(const csp::common::Optional<csp::common::String> &OrganizationId, const InviteOrganizationRoleCollection &InviteUsers, NullResultCallback Callback)
Invites all the given emails to the User’s Organization.
Only a User with an Admin or Owner Organization role can invite people to the organization. If the User does not have the required role their call will be rejected.
- Parameters
OrganizationId – csp::common::Optional<csp::common::String> : Id of the Organization the users should be added to. If no Id is specified, the Id of the Organization the user is currently authenticated against will be used.
InviteUsers – InviteOrganizationRoleCollection : Collection containing the EmailLinkUrl and SignupUrl as well as the emails and Organization role/s of the Users to be invited.
Callback – NullResultCallback : Callback when asynchronous task finishes.
-
void GetUserRolesInOrganization(const csp::common::Optional<csp::common::String> &OrganizationId, const csp::common::Array<csp::common::String> &UserIds, OrganizationRolesResultCallback Callback)
Retrieves the Organisation User Role information for the User Ids that have been passed in.
Only a User with an Admin or Owner Organization role can request the role information for other Organization members. A User without these roles can only request information about their own Organization role and should pass an array containing only their own User Id.
- Parameters
OrganizationId – csp::common::Optional<csp::common::String> : Id of the Organization you want to get user roles for. If no Id is specified, the Id of the Organization the user is currently authenticated against will be used.
UserIds – csp::common::Array<csp::common::String> : Array of User Ids for which the Organization User Roles will be retrieved.
Callback – OrganizationRolesResultCallback : Callback when asynchronous task finishes.
-
void RemoveUserFromOrganization(const csp::common::Optional<csp::common::String> &OrganizationId, const csp::common::String &UserId, NullResultCallback Callback)
Removes a User from the Organization.
Only a User with an Admin or Owner Organization role can remove other Users from the Organization. If the user does not have the required role their call will be rejected. Anyone can remove themselves from an Organization.
- Parameters
OrganizationId – csp::common::Optional<csp::common::String> : Id of the Organization you want to remove a user from. If no Id is specified, the Id of the Organization the user is currently authenticated against will be used.
UserId – csp::common::String : Unique ID of User.
Callback – NullResultCallback : Callback when asynchronous task finishes.
-
typedef std::function<void(csp::common::String)> MemberJoinedOrganizationCallback