Snippet Visibility and Permissions
## Problem to Solve There are two kinds of Snippets in GitLab: 1. Personal Snippets - i.e. `/dashboard/snippets` 1. Project Snippets - i.e. `/<NAMESPACE>/<PROJECT>/snippets` For personal snippets users who create these are unable to collaborate or share these with other users due to limited visibility options. Snippets can either be `public` (open to the world) or `private` (restricted to only the author). This limits options for sharing and collaboration in these Snippets. In Project Snippets working on the snippet is only available to the original author of the Snippet (or an instance Admin). This means that Snippets created inside of a project don't follow normal project based permissions of who can edit the content. Worse, if a member leaves a project the Snippet could be orphaned and only an Administrator would be able to modify the Snippet. ## Vision We want Snippets to support collaboration between multiple users in GitLab, so that Snippets are valuable part of a developers toolkit for sharing content. ## Competitive Analysis - [GitHub Gists](https://gist.github.com/): GitHub Gists only exist for personal users and not inside of a project. Currently Gists are more flexible in sharing in that they can be public or secret (accessible via link), but they don't support a private concept. There is no way for other people to collaborate on a Gist other than through commenting. - [BitBucket Snippets](https://bitbucket.org/snippets/): BitBucket Snippets belong to workspaces (group/namespace) and have visibility settings of either Public (to anyone) or Private (author only). ## Proposal GitLab should better align visibility and permission settings of both personal and project Snippets to better support collaboration. - **Personal Snippets:** - Introduce a new visibility level for personal snippets that allows sharing a Snippet to other users through a link. These Snippets would not be publicly discoverable, but would be accessible to anyone with the link. https://gitlab.com/groups/gitlab-org/-/epics/2733 - **Project Snippets:** - Align project snippet edit permissions to project permissions. This would allow users with the role of Developer or above inside of a project to make changes to the content of a Snippet. https://gitlab.com/gitlab-org/gitlab/-/issues/16256 - Reduce confusion of visibility permissions for project based Snippets. **FURTHER INVESTIGATION REQUIRED** - **Both:** - Allow other users to suggest changes to a snippet. https://gitlab.com/gitlab-org/gitlab/-/issues/212884 ## Links/References
epic