Documentation

InitUserPerms

array
CSocNetUserPerms::InitUserPerms(
 int currentUserID,
 int userID,
 bool bCurrentUserIsAdmin
);

The method initializes array of user access permissions for operations with target user profile. Static method.

Parameters

Parameter Description Available from version
currentUserID User ID who's access permissions are verified.
userID User ID, who's profile is accessed.
bCurrentUserIsAdmin Flag specifying if the user is an administrator who's permissions are verified.

Returned value

Array with keys:
IsCurrentUser - flag, specifies that the current user's profile is accessed,
Relation - association between users,
Operations - array of operations:
modifyuser - permission to modify profile, if main module settings allow profile editing,
modifyuser_main - permission to modify user profile,
viewcontacts - permission to view contact information,
invitegroup - invitation to a group,
message - sending personal message,
viewfriends - viewing of friends,
viewgroups - viewing of groups,
viewprofile - viewing of profile.

Example:

Array 
( 
 [Operations] => Array 
	 ( 
		 [modifyuser] => 1 
		 [viewcontacts] => 1 
		 [invitegroup] => 1 
		 [message] => 1 
		 [viewfriends] => 1 
		 [viewgroups] => 1 
		 [viewprofile] => 1 
		 [modifyuser_main] => 
	 ) 

 [IsCurrentUser] => 
 [Relation] => 
)


© «Bitrix24», 2001-2024