Documentation

SetPostPerms

void
CBlogPost::SetPostPerms(
 int    ID,
 array  arPerms,
 string permsType = BLOG_PERMS_POST
);

The method defines level of access permissions to a blog post and comments for the blog post withID. Non-static method.

Method parameters

ParameterDescription
ID Blog post ID.
arPerms Array of the array("BlogUserGroupID" => "Permissions"[, ...]) type , where
BlogUserGroupID - user group ID for the current blog,
Permissions - level of access permissions. Optional parameter.
permsType Type of access permissions level, which must be specified. Possible values:
  • BLOG_PERMS_POST - for a blog post;
  • BLOG_PERMS_COMMENT - for comment to a blog post.
Optional. By default equals to BLOG_PERMS_POST - change level of access permission to a blog post.

See Also

Examples of use

<?
$ID = 1;
$arPerms = Array(
        "1" => BLOG_PERMS_READ,
        "2" => BLOG_PERMS_WRITE
    );
CBlogPost::SetPostPerms($ID, $arPerms, BLOG_PERMS_COMMENT);
?>


© «Bitrix24», 2001-2024
Up