GroupOperations
public struct GroupOperations
IronOxide Group Operations
Key Terms
- ID - The ID representing a group. It must be unique within the group’s segment and will not be encrypted.
- Name - The human-readable name of a group. It does not need to be unique and will not be encrypted.
- Member - A user who is able to encrypt and decrypt data using the group.
- Admin - A user who is able to manage the group’s member and admin lists. An admin cannot encrypt or decrypt data using the group unless they first add themselves as group members or are added by another admin.
- Owner - The user who owns the group. The owner has the same permissions as a group admin, but is protected from being removed as a group admin.
- Rotation - Changing a group’s private key while leaving its public key unchanged. This can be accomplished by calling
SDK.group.rotatePrivateKey
.
-
Lists all of the groups that the current user is an admin or a member of.
Declaration
Swift
public func list() -> Result<GroupListResult, IronOxideError>
-
Gets the full metadata for a group.
The encrypted private key for the group will not be returned.
Declaration
Swift
public func getMetadata(groupId: GroupId) -> Result<GroupGetResult, IronOxideError>
Parameters
groupId
ID of the group to retrieve
-
Creates a group.
With default
GroupCreateOpts
, the group will be assigned an ID and have no name. The creating user will become the owner of the group and the only group member and administrator.Declaration
Swift
public func create(groupCreateOpts: GroupCreateOpts = GroupCreateOpts()) -> Result<GroupCreateResult, IronOxideError>
Parameters
groupCreateOpts
Group creation parameters
-
Modifies or removes a group’s name.
Returns the updated metadata of the group.
Declaration
Swift
public func updateName(groupId: GroupId, groupName: GroupName?) -> Result<GroupMetaResult, IronOxideError>
Parameters
groupId
ID of the group to update
groupName
New name for the group. Provide a
GroupName
to update to a new name ornil
to clear the group’s name -
Deletes a group.
A group can be deleted even if it has existing members and administrators.
Warning: Deleting a group will prevent its members from decrypting all of the documents previously encrypted to the group. Caution should be used when deleting groups.
Declaration
Swift
public func delete(groupId: GroupId) -> Result<GroupId, IronOxideError>
Parameters
groupId
ID of the group to delete
-
Adds members to a group.
Returns successful and failed additions.
Declaration
Swift
public func addMembers(groupId: GroupId, users: [UserId]) -> Result<GroupAccessEditResult, IronOxideError>
Parameters
groupId
ID of the group to add members to
users
List of users to add as group members
-
Removes members from a group.
Returns successful and failed removals.
Declaration
Swift
public func removeMembers(groupId: GroupId, users: [UserId]) -> Result<GroupAccessEditResult, IronOxideError>
Parameters
groupId
ID of the group to remove members from
users
List of users to remove as group members
-
Adds administrators to a group.
Returns successful and failed additions.
Declaration
Swift
public func addAdmins(groupId: GroupId, users: [UserId]) -> Result<GroupAccessEditResult, IronOxideError>
Parameters
groupId
ID of the group to add administrators to
users
List of users to add as group administrators
-
Removes administrators from a group.
Returns successful and failed removals.
Declaration
Swift
public func removeAdmins(groupId: GroupId, users: [UserId]) -> Result<GroupAccessEditResult, IronOxideError>
Parameters
groupId
ID of the group to remove administrators from
users
List of users to remove as group administrators
-
Rotates a group’s private key while leaving its public key unchanged.
There’s no black magic here! This is accomplished via multi-party computation with the IronCore webservice.
Note: You must be an administrator of a group in order to rotate its private key.
Declaration
Swift
public func rotatePrivateKey(groupId: GroupId) -> Result<GroupUpdatePrivateKeyResult, IronOxideError>
Parameters
groupId
ID of the group whose private key should be rotated