orgHasEntitlement method
Server-side check for a single entitlement key scoped to a specific org.
Calls org_has_entitlement(org_id, key) from migration 053.
Implementation
Future<bool> orgHasEntitlement(String orgId, String key) async {
try {
final result = await _client.rpc(
'org_has_entitlement',
params: {'p_org_id': orgId, 'p_key': key},
);
return result == true;
} catch (e) {
dev.log(
'orgHasEntitlement($orgId, $key) failed: $e',
name: 'EntitlementDatasource',
);
return false;
}
}