Polls by Pagelove · Authorization rules

Pagelove is deny-by-default. Every read and write the app performs is granted here, and nothing else.

ActorResourceMethodSelectorAction
*
  • /index.html
  • /polls/*
  • /assets/*
  • GET
  • HEAD
  • OPTIONS
allow
* /templates/new-poll.html
  • POST
allow
* /polls/*
  • PUT
allow
* /polls/*
  • POST
tbody#responses allow
* /polls/*
  • PUT
  • DELETE
tbody#responses > tr[itemtype="https://pagelove.org/PollResponse"] allow

Shape constraints

Closed shapes: a write that introduces any element or attribute not listed below is rejected with 422. They fire on the granular write paths the app uses (POST into the responses body, PUT/DELETE on a response row).

Responses body (POST target) tr[id][itemscope][itemtype="https://pagelove.org/PollResponse"] th[scope="row"][itemprop="name"] td[itemprop="vote"][data-option][data-vote]
Response row (PUT / DELETE target) :has(> th[itemprop="name"]) th[scope="row"][itemprop="name"] td[itemprop="vote"][data-option][data-vote]

Triggers

Templated creation needs a document-level PUT grant on /polls/*. On its own that grant would let any visitor replace any element of an existing poll, or the whole document. These triggers run before the write and refuse what the rules alone cannot express.

Element-level writes: only POST into #responses and PUT on a response row
Whole-document PUT: a poll that already exists cannot be overwritten
Powered by Pagelove