You are here

createGroup

The createGroup methods are used to create groups.

createGroup(groupName)

createGroup(groupName) this method creates a new top-level where groupName is the unique group name to create.

Parameters

group
The unique group name to create

Example

    var groupName = "TECH_WRITERS";
    var newGroup = people.getGroup("GROUP_"+groupName);
    if(!newGroup){
        newGroup = people.createGroup(groupName);
    }          
        

createGroup(parentGroup,groupName)

createGroup(parentGroup, groupName) this method creates a new group as a child of the specified parent group node. This can be null for a top-level group.

Parameters

parentGroup
The parent group
groupName
The group name

Example

    var parentGroupName = "TECH_WRITERS";
    var parentGroup = people.getGroup("GROUP_"+parentGroupName);
    var subGroup = "TECH_WRITER_ELITE"; // do not prefix with GROUP_
    
    if(parentGroup){
        newGroup = people.createGroup(parentGroup, subGroup);
        model.newGroup = newGroup;
    }
        

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.