Documentation

CForumTopic::CanUserAddTopic

bool
CanUserAddTopic(
 int FID,
 array arUserGroups,
 int iUserID
);

The method CanUserAddTopic thoroughly checks whether a specified user who is a member of a specified group can add a new topic to a specified forum.

Parameters

ParameterDescription
FID The ID of the forum to which a user wants to add a topic.
arUserGroups Array of groups whose member this user is. Array of groups of the current user is returned by $USER->GetUserGroupArray().
iUserID The user ID. The current user ID is returned by $USER->GetID().

Return Values

Returns true if the user has all the permissions required to add a topic, or false otherwise.

See Also

  • CForumTopic::CanUserUpdateTopic
  • CForumTopic::CanUserDeleteTopic

    Example


    
    <?
    if (CForumTopic::CanUserAddTopic($FID, $USER->GetUserGroupArray(), $USER->GetID()))
    {
    	echo "You can add topic!";
    }
    ?>
  • © «Bitrix24», 2001-2024
    Up