WordPress File wp-includes/class-wp-user.php

WP_User::get_role_caps()

Retrieves all of the capabilities of the user’s roles, and merges them with individual user capabilities.

WP_User::get_site_id()

Gets the ID of the site for which the user’s capabilities are currently initialized.