Documentation

CForumMessage::CanUserAddMessage

bool
CanUserAddMessage(
 int TID,
 array arUserGroups,
 int iUserID
);

The method CanUserAddMessage thoroughly checks whether a specified user who is a member of a specified group can add a new message into a specified topic.

Parameters

ParameterDescription
TID The ID of the topic to which a user wants to add a message.
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 message, or false otherwise.

See Also

  • CForumMessage::CanUserUpdateMessage
  • CForumMessage::CanUserDeleteMessage

    Example


    
    <?
    if (CForumMessage::CanUserAddMessage($TID, $USER->GetUserGroupArray(), $USER->GetID()))
    {
    	echo "You can add message!";
    }
    ?>
  • © «Bitrix24», 2001-2024
    Up