You are here

function group_user_can_leave in Group 7

Check whether a user can leave a group.

Parameters

Group $group: The group to check access for.

object $account: The user to check access for.

GroupMembership|false $group_membership: The group membership of the user that wants to leave.

Return value

bool Whether the user can leave the group.

1 string reference to 'group_user_can_leave'
group_group_membership_action_info in ./group.group.inc
Implements hook_group_membership_action_info().

File

./group.group.inc, line 508
Hook implementations for the Group module.

Code

function group_user_can_leave(Group $group, $account, $group_membership) {
  return !empty($group_membership) && group_access('leave group', $group, $account);
}