FusionAuth.Groups (FusionAuth v0.3.0) View Source
The FusionAuth.Groups
module provides access methods to the FusionAuth Groups API.
All methods require a Tesla Client struct created with FusionAuth.client(base_url, api_key)
.
Group Fields
id :: String.t()
The unique Id of this Group. If not specified a secure random UUID will be generated.
tenantId :: String.t()
The tenant of which this Group belongs to.
name :: String.t()
The unique name of the Group.
data :: map()
An object that can hold any information about the Group that should be persisted.
roles :: map()
The roles assigned to this Group. The map key is the Application Id, the value is an array of Application Roles.
Member Fields
id :: String.t()
The unique Id of this Group Member. If not specified a secure random UUID will be generated.
userId :: String.t()
The user of which this Group Member belongs to.
data :: map()
An object that can hold any information about the Group Member that should be persisted.
insertInstant :: integer()
Value represents the instant them member was created in epoch time
Examples
iex> client = FusionAuth.client(...)
iex> FusionAuth.Groups.get_group(client, "a4c99f4f-24d5-49bf-921f-ff80fc76b3ef")
{
:ok,
%{
"group" => %{
"data" => %{"description" => "My First Group"},
"id" => "a4c99f4f-24d5-49bf-921f-ff80fc76b3ef",
"name" => "Group",
"roles" => %{
"861f5558-34a8-43e4-ab50-317bdcd47671" => [
%{
"description" => "admin",
"id" => "3ebbc43c-7add-42cd-87b4-c6eca0438c6c",
"isDefault" => true,
"isSuperRole" => true,
"name" => "admin"
}
]
},
"tenantId" => "edad5b36-25a2-0631-3694-64ba3d39bce9"
}
},
%Tesla.Env{...}
}
iex> FusionAuth.Groups.add_member(client, "a4c99f4f-24d5-49bf-921f-ff80fc76b3ef", "84846873-89d2-44f8-91e9-dac80f420cb2")
{
:ok,
%{
"members" => %{
"a4c99f4f-24d5-49bf-921f-ff80fc76b3ef" => [
%{
"id" => "67c66607-d3ed-4073-adb2-53de8d10ac4e",
"insertInstant" => 1591306181126,
"userId" => "84846873-89d2-44f8-91e9-dac80f420cb2"
}
]
}
},
%Tesla.Env{...}
}
Link to this section Summary
Functions
Add member to a group.
Add multiple members to a group.
For more information visit the FusionAuth API Documentation for Create a Group
For more information visit the FusionAuth API Documentation for Delete a Group
For more information visit the FusionAuth API Documentation for Retrieve a Group
For more information visit the FusionAuth API Documentation for Retrieve a Group
Remove member by member_id
Remove member by group_id and user_id
Remove members by member_ids or a group_id
Remove members by group_id and user_ids
For more information visit the FusionAuth API Documentation for Update a Group
Link to this section Types
Specs
client() :: FusionAuth.client()
Specs
Specs
group_id() :: String.t()
Specs
Specs
member_id() :: String.t()
Specs
member_ids() :: [member_id()]
Specs
member_list() :: [member()]
Specs
result() :: FusionAuth.result()
Specs
role_id() :: String.t()
Specs
role_ids() :: [role_id()]
Specs
user_id() :: String.t()
Specs
user_ids() :: [user_id()]
Link to this section Functions
Specs
add_member(client(), group_id(), user_id()) :: result()
add_member(client(), group_id(), member()) :: result()
Add member to a group.
For more information visit the FusionAuth API Documentation for Add Users to a Group
Specs
add_members(client(), group_id(), member_list()) :: result()
Add multiple members to a group.
For more information visit the FusionAuth API Documentation for Add Users to a Group
Specs
For more information visit the FusionAuth API Documentation for Create a Group
Specs
For more information visit the FusionAuth API Documentation for Delete a Group
Specs
For more information visit the FusionAuth API Documentation for Retrieve a Group
Specs
For more information visit the FusionAuth API Documentation for Retrieve a Group
Specs
Remove member by member_id
For more information visit the FusionAuth API Documentation for Remove Users from a Group
Specs
Remove member by group_id and user_id
For more information visit the FusionAuth API Documentation for Remove Users from a Group
Specs
Remove members by member_ids or a group_id
For more information visit the FusionAuth API Documentation for Remove Users from a Group
Specs
Remove members by group_id and user_ids
For more information visit the FusionAuth API Documentation for Remove Users from a Group
Specs
For more information visit the FusionAuth API Documentation for Update a Group