Skip to content

Permissions (Pro)

Hook Reference

HookDescription
fluent_affiliate/has_all_affiliate_accessFilters whether the current user has full access to all affiliates.
fluent_affiliate/has_all_referral_accessFilters whether the current user has full access to all referrals.
fluent_affiliate/has_all_visit_accessFilters whether the current user has full access to all visit records.
fluent_affiliate/has_all_payout_accessFilters whether the current user has full access to all payout records.
fluent_affiliate/user_has_affiliate_accessFilters whether a specific user ID has affiliate-level access.

fluent_affiliate/has_all_affiliate_access

Filters whether the current user has full access to all affiliates. Return true to grant access.

Parameters

ParameterTypeDescription
$hasAccessboolWhether the user currently has full affiliate access.

Source: app/Services/PermissionManager.php

php
add_filter('fluent_affiliate/has_all_affiliate_access', function($hasAccess) {
    // Grant access to a custom role
    if (current_user_can('my_affiliate_manager_role')) {
        return true;
    }
    return $hasAccess;
});

fluent_affiliate/has_all_referral_access

Filters whether the current user has full access to all referrals.

Parameters

ParameterTypeDescription
$hasAccessboolWhether the user currently has full referral access.

Source: app/Services/PermissionManager.php

php
add_filter('fluent_affiliate/has_all_referral_access', '__return_true');

fluent_affiliate/has_all_visit_access

Filters whether the current user has full access to all visit records.

Parameters

ParameterTypeDescription
$hasAccessboolWhether the user currently has full visit access.

Source: app/Services/PermissionManager.php

php
add_filter('fluent_affiliate/has_all_visit_access', '__return_true');

fluent_affiliate/has_all_payout_access

Filters whether the current user has full access to all payout records.

Parameters

ParameterTypeDescription
$hasAccessboolWhether the user currently has full payout access.

Source: app/Services/PermissionManager.php

php
add_filter('fluent_affiliate/has_all_payout_access', '__return_true');

fluent_affiliate/user_has_affiliate_access

Filters whether a specific user ID has affiliate-level access.

Parameters

ParameterTypeDescription
$hasAccessboolCurrent access state.
$userIdintWordPress user ID being checked.

Source: app/Services/PermissionManager.php

php
add_filter('fluent_affiliate/user_has_affiliate_access', function($hasAccess, $userId) {
    if (get_user_meta($userId, 'is_affiliate_partner', true)) {
        return true;
    }
    return $hasAccess;
}, 10, 2);

Released under the GPL-2.0 License.