Documentation

SetPerm

int
CSocNetFeaturesPerms::SetPerm(
 int featureID,
 string operation,
 string perm
);

The method sets access permissions for extra features. If a record exists in the database, this record is updated. When record does not exist, it is added. Static method.

Note: CSocNetFeaturesPerms::Add method is used to add a record, and the method CSocNetFeaturesPerms::Update is used to update the record.

Parameters

Parameter Description Available from version
featureID Extra features ID.
operation Name of operation.
perm Access permission for the operation.

Returned value

Returns a record ID.

See Also

Examples

<?
$idTmp = CSocNetFeatures::SetFeature(
	SONET_ENTITY_GROUP,
	$ID,
	"forum",
	true,
	"Discussions"
);
if ($idTmp)
{
	$id1Tmp = CSocNetFeaturesPerms::SetPerm(
		$idTmp,
		"forum_answer",
		SONET_ROLES_MODERATOR
	);
	if (!$id1Tmp)
	{
		if ($e = $GLOBALS["APPLICATION"]->GetException())
			$errorMessage .= $e->GetString();
	}
}
else
{
	if ($e = $GLOBALS["APPLICATION"]->GetException())
		$errorMessage .= $e->GetString();
}
?>


© «Bitrix24», 2001-2024
Up