Documentation

CanUserUpdateUser

bool
CBlogUser::CanUserUpdateUser(
 int ID,
 int userID,
 int selectType = BLOG_BY_BLOG_USER_ID
);

The method verifies whether the site user with userID can modify user profile with the blog ID. Static method.

Method parameters

ParameterDescription
ID User ID.
userID Site user ID.
selectType Specifies ID for the searched user. The following values are possible:
  • BLOG_BY_USER_ID - search by the site user ID;
  • BLOG_BY_BLOG_USER_ID - search by the blog user ID.
Optional. By default, BLOG_BY_BLOG_USER_ID - search by the blog user ID.

Returned value

The method returns true when the user can modify the profile, otherwise returns false.

Examples of use

<?
if(CBlogUser::CanUserUpdateUser(1, $USER->GetID(), BLOG_BY_USER_ID)
    echo "You can update this profile.";
else
    echo "You cannot modify this profile.";
?>


© «Bitrix24», 2001-2024