<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_user_permissions(payload, user_pk):
 """Raise ``PermissionDenied`` if ``payload`` includes ``user_pk``."""

    for perm_type in ['add', 'remove']:
        user_pks = payload.get('users', {}).get(perm_type, {}).keys()
        if user_pk in user_pks:
            raise exceptions.PermissionDenied("You cannot change your own permissions")