Managing groups¶
Creating a group¶
A group provides a way to group together users that have similar roles or tasks. You might, for example, create a group for users who create batch jobs, or a group for users who create pipelines. By grouping together users, you can provide appropriate access permissions for those users, while denying these permissions to other users. For example, only members of the pipeline group would be able to edit and create pipelines.
You create a group using the hubcli group create command.
The following example creates a new group:
hubcli group create group1
This creates a group called group1.
If you want to use a specific connection rather than the default, use the -c flag:
hubcli group create -c myconn group1
Adding a group to another group¶
Groups in Altair SLC Hub follow a strictly hierarchical structure — a group can have at most one parent group but can have multiple subgroups. This can be useful if you want an overall group for, say, program creators, and then subgroups within that for different programming languages.
For example, you could first create the group Programmers:
hubcli group create Programmers
You could then create a subgroup for SAS language programmers:
hubcli group create SLCProgrammers
If you then wanted the SLCProgrammers group as a subgroup of the Programmers group, you could do the following:
hubcli group member add --group SLCProgrammers Programmers
Note
A group can only have one parent group. Attempting to add a group to a second parent group will move it from its current parent to the new one.
Listing groups¶
If you want to check that a group has been successfully created, you can view a list of groups:
hubcli group list
A list of groups is returned to the local device. For example, on Windows you will see something similar to the following:
For example:
ID NAME
ad5a5c72-404d-4662-a1d5-580f94002fc5 HubUsers
d6b0783a-9ad3-4f31-aa48-bbf550430b92 BatchJobUsers
80a4e813-2397-47df-8d3d-47ed03db3f46 DataAccessConsumers
e41351a3-424d-4a66-b121-89072a65bfb0 LinkSessionUsers
9c4c54ff-0173-41ce-9657-a8a909b1cb83 group1
Listing subgroups¶
A group listing only returns a flat list of groups and contains no information about whether they are subgroups of other groups.
To find out if a group is a subgroup of another group, use the hubcli group groups command:
hubcli group groups SLCProgrammers
This lists all groups of which SLCProgrammers is a member.
For example:
GROUP NAME MEMBERSHIP TYPE
Programmers Direct
Membership type can be Direct or Indirect.
If the group is a direct member of the listed group, its membership type is Direct.
If the group is a member of a group which is itself a subgroup of the listed group, its membership type is Indirect.
For example, suppose we add a previously created group SLCProcProgs as a subgroup of SLCProgrammers:
hubcli group member add --group SLCProcProgs SLCProgrammers
If we then obtain information for the group SLCProcProgs:
hubcli group groups SLCProcProgs
the following is returned:
GROUP NAME MEMBERSHIP TYPE
SLCProgrammers Direct
Programmers Indirect
SLCProcProgs is a direct member of SLCProgrammers.
Because SLCProgrammers is a subgroup of Programmers, SLCProcProgs is also an indirect member of Programmers.
Deleting groups¶
You might want to delete a group. You can do this with the hubcli group rm command.
If you want to check you have the correct group name, or want to view a list of groups,
you use the command hubcli group list, described above.
If you want to check whether this group is a subgroup of another group before deleting,
you can use the hubcli group groups command, as described in hubcli group groups.
You can then delete the group by name; for example:
hubcli group rm SLCProgrammers
- This deletes the group
SLCProgrammers. - This does not delete any subgroups of
SLCProgrammers. - The
SLCProgrammersgroup is removed as a subgroup of any group to which it has been added.
Any indirect groups added to a group through theSLCProgrammersgroup are also removed when theSLCProgrammersgroup is deleted.
Removing a subgroup from a group¶
To remove a subgroup from a group without deleting it, use the hubcli group member rm command:
hubcli group member rm --group SLCProcProgs SLCProgrammers
This removes SLCProcProgs from SLCProgrammers but does not delete the group itself.
To verify the correct group name before removing, use hubcli group list.