function party_profile_profile2_access in Party 7
Implements hook_profile2_access().
File
- modules/
party_profile/ party_profile.module, line 32 - Support for configurable user profiles which are not attached to users.
Code
function party_profile_profile2_access($op, $profile, $account) {
// An object means we're dealing with an actual entity. We will ignore any
// other mode, as creation etc of data sets will need to be done through a
// data controller for it to be attached. Operations on an existing profile
// can be done directly.
if (is_object($profile) && !empty($profile->party_attaching_party)) {
$party = party_load($profile->party_attaching_party);
if (party_access($op, $party, $profile->data_set_name, $account)) {
return TRUE;
}
}
}