MCPcopy Create free account
hub / github.com/decaporg/decap-cms / hasWriteAccess

Method hasWriteAccess

packages/decap-cms-backend-github/src/API.ts:267–279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265 }
266
267 async hasWriteAccess() {
268 try {
269 const result: Endpoints['GET /repos/{owner}/{repo}']['response']['data'] = await this.request(
270 this.repoURL,
271 );
272 // update config repoOwner to avoid case sensitivity issues with GitHub
273 this.repoOwner = result.owner.login;
274 return result.permissions?.push ?? false;
275 } catch (error) {
276 console.error('Problem fetching repo data from GitHub');
277 throw error;
278 }
279 }
280
281 reset() {
282 // no op

Callers 1

authenticateMethod · 0.45

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected