Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
phil-lgr opened this issue Nov 7, 2019 · 1 comment

Comments

@phil-lgr
Copy link

phil-lgr commented Nov 7, 2019

- 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
@phil-lgr
Copy link
Author

phil-lgr commented Nov 7, 2019

and I just want to say that git-gateway is absolutely fantastic with Netlify CMS, I'm a happy Netlify customer because of that! 👍 I'm opening this to see if it's something doable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant