Skip to content

Feature request: Ability to pass allowed routes for monorepository sites #38

@phil-lgr

Description

@phil-lgr

- Do you want to request a feature or report a bug?

Feature

- What is the current behavior?

Netlify CMS allow us to pass the following options to git-gateway:

backend:
  name: git-gateway
  accept_roles: #optional - accepts all users if left out
    - admin
    - editor

now from netlify's identity settings the repository is set up:

image

So that means that users from that site have access to the following scopes:

 /repos/:owner/:name/git/
 /repos/:owner/:name/contents/
 /repos/:owner/:name/pulls/
 /repos/:owner/:name/branches/

- What is the expected behavior?

Mono-repository are increasingly popular and people want to have multiple sites under one git repository.

for example, it's very common to have multiple site under packages

packages/
 - site1
 - site2

I would like to be able to pass specific paths to git-gateway in order to restrict a user from site1 to only content of site1, something like:

 /repos/:owner/:name/git/
 /repos/:owner/:name/contents/packages/site1 # restrict to site1 dir only
 /repos/:owner/:name/pulls/
 /repos/:owner/:name/branches/

Maybe something like:

# config.yml for site 1
backend:
  name: git-gateway
  accept_roles: 
    - admin
    - editor
  accept_content_routes: # <------ restrict content access to those paths only
    - packages/site1

# config.yml for site 2
backend:
  name: git-gateway
  accept_roles: 
    - admin
    - editor
  accept_content_routes: # <------ restrict content access to those paths only
    - packages/site2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions