mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-16 03:03:06 +00:00
- campaignAccess.ts (990 lines, ~80 exports) is now a 130-line explicit re-export surface over 14 domain modules in src/utilities/access/ (shared actor predicates + per-collection access); public surface AST-verified identical, import sites untouched - actions/supporter.ts split: single-supporter lifecycle (407) vs the CSV import pipeline in supporterImport.ts (357); 'use server' re-export constraint honored with thin async delegates - organization/stateDeputy clone twins deduped by POLICY: runStaffEntityMutation (fresh staff assert + unique-conflict translation) keeps each caller's concretely-typed Payload mutation - runCampaignRedirectFormAction removes the copy-pasted try/map/redirect ladder from 4 create formActions (planos kept its genuinely custom flow) - Plaza→Municipality identifier rename finished (context keys, list-label and leadership constants, fixture sequence, test constants) - RefreshRouteOnSave (React component) moved out of utilities/ to components/
130 lines
3.1 KiB
TypeScript
130 lines
3.1 KiB
TypeScript
/**
|
|
* Public surface of campaign RBAC; implementations live in
|
|
* `src/utilities/access/*` by domain. Import sites keep importing from
|
|
* `@/utilities/campaignAccess` — add new rules to the matching domain module
|
|
* (or a new one) and re-export them here.
|
|
*/
|
|
|
|
export type { CampaignTransactionRequest } from '@/utilities/access/shared'
|
|
export {
|
|
eligibleCampaignStaffWhere,
|
|
getFreshCampaignUser,
|
|
isCampaignCandidate,
|
|
isCampaignCoordinator,
|
|
isCampaignLeader,
|
|
isCampaignStaff,
|
|
isCampaignUnrestricted,
|
|
isPayloadAdmin,
|
|
payloadAdminOnly,
|
|
} from '@/utilities/access/shared'
|
|
|
|
export {
|
|
canCreateCampaignUserPhone,
|
|
canManageCampaignStaffField,
|
|
canManageCampaignUserRole,
|
|
canManageCampaignUsers,
|
|
canReadCampaignStaffField,
|
|
canReadCampaignUserIdentity,
|
|
canReadCampaignUserPhone,
|
|
canReadCampaignUsers,
|
|
canSetCampaignSystemField,
|
|
canUpdateCampaignUser,
|
|
canUpdateCampaignUserAvatar,
|
|
canUpdateCampaignUserPhone,
|
|
} from '@/utilities/access/campaignUsers'
|
|
|
|
export {
|
|
canAssignMunicipalityAdvisors,
|
|
canCreateMunicipality,
|
|
canDeleteMunicipality,
|
|
canManageMunicipalityAdvisors,
|
|
canReadMunicipality,
|
|
canUpdateMunicipality,
|
|
getAccessibleMunicipalityIds,
|
|
getAdvisorMunicipalityIds,
|
|
getEngagedLeaderMunicipalityIds,
|
|
getOwnEngagedLeadership,
|
|
} from '@/utilities/access/municipalities'
|
|
|
|
export {
|
|
canManageContacts,
|
|
canReadContacts,
|
|
getAccessibleContactIds,
|
|
} from '@/utilities/access/contacts'
|
|
|
|
export {
|
|
canCreateLeadership,
|
|
canDeleteLeadership,
|
|
canManageLeadership,
|
|
canReadLeadership,
|
|
canSetAdministrativeLeadershipField,
|
|
getAccessibleLeadershipIds,
|
|
} from '@/utilities/access/leaderships'
|
|
|
|
export {
|
|
canCreateVotePledge,
|
|
canDeleteVotePledge,
|
|
canReadVotePledge,
|
|
canUpdateVotePledge,
|
|
} from '@/utilities/access/votePledges'
|
|
|
|
export {
|
|
canCreateMunicipalityUpdate,
|
|
canMutateMunicipalityUpdate,
|
|
canReadMunicipalityUpdate,
|
|
canSetMunicipalityUpdateAuthor,
|
|
} from '@/utilities/access/municipalityUpdates'
|
|
|
|
export {
|
|
canCreateCampaignInvite,
|
|
canMutateCampaignInvite,
|
|
canReadCampaignInvite,
|
|
canSetCampaignInviteSystemField,
|
|
} from '@/utilities/access/invites'
|
|
|
|
export {
|
|
canCreateSupporter,
|
|
canDeleteSupporter,
|
|
canManageSupporter,
|
|
canReadSupporter,
|
|
} from '@/utilities/access/supporters'
|
|
|
|
export {
|
|
canCreateOrganization,
|
|
canDeleteOrganization,
|
|
canManageOrganization,
|
|
canReadOrganization,
|
|
} from '@/utilities/access/organizations'
|
|
|
|
export {
|
|
canCreateCampaignDemand,
|
|
canDeleteCampaignDemand,
|
|
canReadCampaignDemand,
|
|
canUpdateCampaignDemand,
|
|
} from '@/utilities/access/demands'
|
|
|
|
export {
|
|
canCreateActionPlan,
|
|
canCreateActionPlanAdvisors,
|
|
canDeleteActionPlan,
|
|
canManageActionPlanAdvisors,
|
|
canReadActionPlan,
|
|
canSetActionPlanStatus,
|
|
canSetActionPlanSystemField,
|
|
canUpdateActionPlan,
|
|
} from '@/utilities/access/actionPlans'
|
|
|
|
export type { ElectionDataReader } from '@/utilities/access/elections'
|
|
export {
|
|
assertCanReadElectionData,
|
|
canMutateElectionData,
|
|
canReadElectionData,
|
|
canReadElectionDataAsUser,
|
|
} from '@/utilities/access/elections'
|
|
|
|
export {
|
|
canCreateStateDeputy,
|
|
canDeleteStateDeputy,
|
|
canManageStateDeputy,
|
|
canReadStateDeputy,
|
|
} from '@/utilities/access/stateDeputies'
|