SolidLabResearch / Challenges

24 stars 0 forks source link

Determine permissions for resource #40

Closed pheyvaer closed 2 years ago

pheyvaer commented 2 years ago

Pitch

Desired solution

Acceptance criteria

Pointers

I did the following in an app:

async function canWriteToResource(resource, solidFetch) {
  const response = await solidFetch(resource,
    {
      method: 'HEAD'
    });

  const header = response.headers.get('wac-allow');

  if (header) {
    return header.includes('write');
  }

  return false;
}
RubenVerborgh commented 2 years ago

Just https://solidproject.org/TR/wac#wac-allow and https://github.com/RubenVerborgh/wac-allow? I.e., I think it's a pure development issue, and libraries already exist.

pheyvaer commented 2 years ago

Sweet! This works for me.