Interface UserGroupApi

interface UserGroupApi {
    create(name: string): UserGroup;
    get(groupId: number): UserGroup;
    get(name: string): UserGroup;
    getAll(): UserGroup[];
    remove(groupId: number): boolean;
    remove(name: string): boolean;
}

Methods

  • Creates and returns new user group.

    When the name parameter is empty or user group with the given name already exist will throw exception with an appropriate message.

    Parameters

    • name: string

    Returns UserGroup

  • Returns user group with given id.

    Parameters

    • groupId: number

    Returns UserGroup

  • Returns user group object with given name.

    Parameters

    • name: string

    Returns UserGroup

  • Delete the user group

    Parameters

    • groupId: number

      The id of the group to delete

    Returns boolean

    This will remove the group from all users. User objects that were previously obtained via UserApi.get will not have their group attribute updated though.

  • Delete the user group

    Parameters

    • name: string

      The name of the group to delete

    Returns boolean

    This will remove the group from all users. User objects that were previously obtained via UserApi.get will not have their group attribute updated though.