{"size": 1048, "ext": "js", "max_stars_repo_path": "apps/condo/domains/billing/access/BillingMeterResource.js", "max_stars_repo_name": "SavelevMatthew/condo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "apps/condo/domains/billing/access/BillingMeterResource.js", "max_issues_repo_name": "SavelevMatthew/condo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "apps/condo/domains/billing/access/BillingMeterResource.js", "max_forks_repo_name": "SavelevMatthew/condo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.8235294118, "max_line_length": 103, "alphanum_fraction": 0.6898854962}
/**
 * Generated by `createschema billing.BillingMeterResource 'name:Text'`
 */

async function canReadBillingMeterResources ({ authentication: { item: user } }) {
    if (!user) return false
    if (user.isAdmin) return {}
    return {
        // TODO(codegen): write canReadBillingMeterResources logic!
    }
}

async function canManageBillingMeterResources ({ authentication: { item: user }, operation, itemId }) {
    if (!user) return false
    if (user.isAdmin) return true
    if (operation === 'create') {
        // TODO(codegen): write canManageBillingMeterResources create logic!
        return true
    } else if (operation === 'update') {
        // TODO(codegen): write canManageBillingMeterResources update logic!
        return true
    }
    return false
}

/*
  Rules are logical functions that used for list access, and may return a boolean (meaning
  all or no items are available) or a set of filters that limit the available items.
*/
module.exports = {
    canReadBillingMeterResources,
    canManageBillingMeterResources,
}
