Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
UserGroup Struct Reference

A datatype to store user credentials. More...

#include <user_group.h>

Collaboration diagram for UserGroup:
[legend]

Public Member Functions

GRASSROOTS_USERS_API UserGroupAllocateUserGroup (const char *name_s)
 Allocate a UserGroup with the given name. More...
 
GRASSROOTS_USERS_API void FreeUserGroup (UserGroup *group_p)
 Free a UserGroup. More...
 
GRASSROOTS_USERS_API json_t * GetUserGroupAsJSON (UserGroup *group_p, const bool full_user_flag)
 Get the json for a UserGroup. More...
 
GRASSROOTS_USERS_API UserGroupGetUserGroupFromJSON (const json_t *group_json_p)
 Get a UserGroup from a json representation. More...
 
GRASSROOTS_USERS_API bool AddUserToGroup (UserGroup *group_p, User *user_p)
 Add a given User to a UserGroup. More...
 
GRASSROOTS_USERS_API bool IsUserInGroup (const UserGroup *const group_p, const User *const user_p)
 Check whether a given User is a member of a UserGroup. More...
 

Data Fields

char * ug_name_s
 
LinkedListug_users_p
 

Detailed Description

A datatype to store user credentials.

Member Function Documentation

◆ AllocateUserGroup()

GRASSROOTS_USERS_API UserGroup * AllocateUserGroup ( const char *  name_s)

Allocate a UserGroup with the given name.

Parameters
name_sThe name of the group.
Returns
A newly-allocated UserGroup or NULL upon error.

◆ FreeUserGroup()

GRASSROOTS_USERS_API void FreeUserGroup ( UserGroup group_p)

Free a UserGroup.

Parameters
group_pThe UserGroup to free.

◆ GetUserGroupAsJSON()

GRASSROOTS_USERS_API json_t * GetUserGroupAsJSON ( UserGroup group_p,
const bool  full_user_flag 
)

Get the json for a UserGroup.

Parameters
user_pThe UserGroup to get the json for.
Returns
The json representation or NULL upon error.

◆ GetUserGroupFromJSON()

GRASSROOTS_USERS_API UserGroup * GetUserGroupFromJSON ( const json_t *  group_json_p)

Get a UserGroup from a json representation.

Parameters
group_json_pThe The json representation.
Returns
The UserGroup or NULL upon error.

◆ AddUserToGroup()

GRASSROOTS_USERS_API bool AddUserToGroup ( UserGroup group_p,
User user_p 
)

Add a given User to a UserGroup.

Parameters
group_pThe UserGroup to add the User to.
user_pThe User to add.
Returns
true if the User was added successfully, false otherwise

◆ IsUserInGroup()

GRASSROOTS_USERS_API bool IsUserInGroup ( const UserGroup *const  group_p,
const User *const  user_p 
)

Check whether a given User is a member of a UserGroup.

Parameters
group_pThe UserGroup to check.
user_pThe User to check for.
Returns
true if the User is a member of the UserGroup, false otherwise

Field Documentation

◆ ug_name_s

char* ug_name_s

◆ ug_users_p

LinkedList* ug_users_p

The documentation for this struct was generated from the following file: