• HOME
  • INTEGRATIONS
  • SDKS
  • GUIDES
  • API DOCS
No results for ""
EXPAND ALL
launchdarkly.com

EDIT ON GITHUB

Creating private projects with custom roles

Read time: 1 minute
Last edited: Oct 22, 2020

Overview

This topic explains how to use custom roles to create private projects or restrict access to projects. It gives examples of both how to restrict access to one project, effectively creating a private project for members you choose, and to grant access only to one or some projects.

This topic uses the viewProject action to restrict and grant access to projects. To learn more about this action, read Using actions.

Team members can't modify what they can't see
Viewing access is required to modify a resource, so if a member cannot view a resource, they also cannot modify it in any way. You can use the policies below to control who can access and modify the feature flags or other child resources in a project.

Restricting access to a project

This example policy forbids viewing access to a project called project-1.

This policy is useful for restricting access to a project to only those team members who are working on it.

The following code sample restricts view and edit access to a project:

1[
2 {
3 "resources": ["proj/project-1"],
4 "actions": ["viewProject"],
5 "effect": "deny"
6 }
7]

Granting access to specific projects

You can restrict individual members' or teams' access to certain projects by explicitly denying view access to projects you do not want them to see. Excluding most projects effectively creates a dashboard and project picker that only displays the projects you want a given user or group to see.

You can even restrict teams or members to their own project-based workspace by allowing them to see only one project.

The example below allows access to every project in an environment except the four listed in the "resources" parameter.

1[
2 {
3 "resources": ["proj/project-1", "proj/project-2", "proj/project-3", "proj/project-4"],
4 "actions": ["viewProject"],
5 "effect": "deny"
6 }
7]