addGroupToContentPermission

addGroupToContentPermission

Syntax

addGroupToContentPermission(permissionType, pageId, groupName)

Package

Alias

Pkg Usage

Description

Adds a selected group to a content permission (usually to a page permission) if the group is not in that permission already.

Parameters

Parameter name

Type

Required

Description

permissionType

String

Yes

Permission type a group will be added to. Valid permission types are (View, Edit)

pageId

Number

Yes

The ID of the page to add permission to.

groupName

String

Yes

The name of a group to add in permission.

Return Type

Boolean (true/false)

Returns true if content permission was actually changed by the routine invocation, i.e. a group was actually added to the specified content permission. Returns false if a content permission was not changed.

Example

Allows members of the group "confluence-users" to modify page with id 11508.

addGroupToContentPermission("Edit", 11508, "confluence-users");

If the routine returns false, it doesn't mean that a group doesn't have the specified permission. It just means that the state of the content permission was not changed. For example, if the specified group was in the specified content permission before the routine invocation, the routine will return false, because the state of the content permission was not changed. In order to check if the specified group has a certain content permission please use the following routine: groupHasContentPermission.

See also

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.