public bool CheckUserInGroup( User user, UserGroup userGroup )
Does the user belong to this group
Syntax
public bool CheckUserInGroup( User user, UserGroup userGroup )
Parameters
- user
- Type: User
User. Object. Access path: PublicAPI.Portal.Security.User
- userGroup
- Type: UserGroup
Group. Object. Access path: PublicAPI.Portal.Security.UserGroup
Return Value
Type: Booleantrue if the user is in the group
Examples
//load the user by ID var user = PublicAPI.Portal.Security.User.Load(3); //load the user group by ID var userGroup = PublicAPI.Portal.Security.UserGroup.Load(3); //check if the user is in the group var check = PublicAPI.Portal.Security.UserGroup.CheckUserInGroup(user, userGroup); //check = true, if the user belongs to the group //check = false, if the user does not belong to the group
See Also