1. Packages
  2. AzureDevOps
  3. API Docs
  4. AreaPermissions
Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi

azuredevops.AreaPermissions

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi

    Manages permissions for an Area (Component)

    Note Permissions can be assigned to group principals and not to single user principals.

    Permission levels

    Permission for Areas within Azure DevOps can be applied on two different levels. Those levels are reflected by specifying (or omitting) values for the arguments project_id and path.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        name: "Example Project",
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const example-project-readers = azuredevops.getGroupOutput({
        projectId: example.id,
        name: "Readers",
    });
    const example_root_permissions = new azuredevops.AreaPermissions("example-root-permissions", {
        projectId: example.id,
        principal: example_project_readers.apply(example_project_readers => example_project_readers.id),
        path: "/",
        permissions: {
            CREATE_CHILDREN: "Deny",
            GENERIC_READ: "Allow",
            DELETE: "Deny",
            WORK_ITEM_READ: "Allow",
        },
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        name="Example Project",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example_project_readers = azuredevops.get_group_output(project_id=example.id,
        name="Readers")
    example_root_permissions = azuredevops.AreaPermissions("example-root-permissions",
        project_id=example.id,
        principal=example_project_readers.id,
        path="/",
        permissions={
            "CREATE_CHILDREN": "Deny",
            "GENERIC_READ": "Allow",
            "DELETE": "Deny",
            "WORK_ITEM_READ": "Allow",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		example_project_readers := azuredevops.LookupGroupOutput(ctx, azuredevops.GetGroupOutputArgs{
    			ProjectId: example.ID(),
    			Name:      pulumi.String("Readers"),
    		}, nil)
    		_, err = azuredevops.NewAreaPermissions(ctx, "example-root-permissions", &azuredevops.AreaPermissionsArgs{
    			ProjectId: example.ID(),
    			Principal: example_project_readers.ApplyT(func(example_project_readers azuredevops.GetGroupResult) (*string, error) {
    				return &example_project_readers.Id, nil
    			}).(pulumi.StringPtrOutput),
    			Path: pulumi.String("/"),
    			Permissions: pulumi.StringMap{
    				"CREATE_CHILDREN": pulumi.String("Deny"),
    				"GENERIC_READ":    pulumi.String("Allow"),
    				"DELETE":          pulumi.String("Deny"),
    				"WORK_ITEM_READ":  pulumi.String("Allow"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var example_project_readers = AzureDevOps.GetGroup.Invoke(new()
        {
            ProjectId = example.Id,
            Name = "Readers",
        });
    
        var example_root_permissions = new AzureDevOps.AreaPermissions("example-root-permissions", new()
        {
            ProjectId = example.Id,
            Principal = example_project_readers.Apply(example_project_readers => example_project_readers.Apply(getGroupResult => getGroupResult.Id)),
            Path = "/",
            Permissions = 
            {
                { "CREATE_CHILDREN", "Deny" },
                { "GENERIC_READ", "Allow" },
                { "DELETE", "Deny" },
                { "WORK_ITEM_READ", "Allow" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.AzuredevopsFunctions;
    import com.pulumi.azuredevops.inputs.GetGroupArgs;
    import com.pulumi.azuredevops.AreaPermissions;
    import com.pulumi.azuredevops.AreaPermissionsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Project("example", ProjectArgs.builder()        
                .name("Example Project")
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            final var example-project-readers = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
                .projectId(example.id())
                .name("Readers")
                .build());
    
            var example_root_permissions = new AreaPermissions("example-root-permissions", AreaPermissionsArgs.builder()        
                .projectId(example.id())
                .principal(example_project_readers.applyValue(example_project_readers -> example_project_readers.id()))
                .path("/")
                .permissions(Map.ofEntries(
                    Map.entry("CREATE_CHILDREN", "Deny"),
                    Map.entry("GENERIC_READ", "Allow"),
                    Map.entry("DELETE", "Deny"),
                    Map.entry("WORK_ITEM_READ", "Allow")
                ))
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
      example-root-permissions:
        type: azuredevops:AreaPermissions
        properties:
          projectId: ${example.id}
          principal: ${["example-project-readers"].id}
          path: /
          permissions:
            CREATE_CHILDREN: Deny
            GENERIC_READ: Allow
            DELETE: Deny
            WORK_ITEM_READ: Allow
    variables:
      example-project-readers:
        fn::invoke:
          Function: azuredevops:getGroup
          Arguments:
            projectId: ${example.id}
            name: Readers
    

    PAT Permissions Required

    • Project & Team: vso.security_manage - Grants the ability to read, write, and manage security permissions.

    Create AreaPermissions Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AreaPermissions(name: string, args: AreaPermissionsArgs, opts?: CustomResourceOptions);
    @overload
    def AreaPermissions(resource_name: str,
                        args: AreaPermissionsArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def AreaPermissions(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        permissions: Optional[Mapping[str, str]] = None,
                        principal: Optional[str] = None,
                        project_id: Optional[str] = None,
                        path: Optional[str] = None,
                        replace: Optional[bool] = None)
    func NewAreaPermissions(ctx *Context, name string, args AreaPermissionsArgs, opts ...ResourceOption) (*AreaPermissions, error)
    public AreaPermissions(string name, AreaPermissionsArgs args, CustomResourceOptions? opts = null)
    public AreaPermissions(String name, AreaPermissionsArgs args)
    public AreaPermissions(String name, AreaPermissionsArgs args, CustomResourceOptions options)
    
    type: azuredevops:AreaPermissions
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AreaPermissionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AreaPermissionsArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AreaPermissionsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AreaPermissionsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AreaPermissionsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var areaPermissionsResource = new AzureDevOps.AreaPermissions("areaPermissionsResource", new()
    {
        Permissions = 
        {
            { "string", "string" },
        },
        Principal = "string",
        ProjectId = "string",
        Path = "string",
        Replace = false,
    });
    
    example, err := azuredevops.NewAreaPermissions(ctx, "areaPermissionsResource", &azuredevops.AreaPermissionsArgs{
    	Permissions: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Principal: pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Path:      pulumi.String("string"),
    	Replace:   pulumi.Bool(false),
    })
    
    var areaPermissionsResource = new AreaPermissions("areaPermissionsResource", AreaPermissionsArgs.builder()
        .permissions(Map.of("string", "string"))
        .principal("string")
        .projectId("string")
        .path("string")
        .replace(false)
        .build());
    
    area_permissions_resource = azuredevops.AreaPermissions("areaPermissionsResource",
        permissions={
            "string": "string",
        },
        principal="string",
        project_id="string",
        path="string",
        replace=False)
    
    const areaPermissionsResource = new azuredevops.AreaPermissions("areaPermissionsResource", {
        permissions: {
            string: "string",
        },
        principal: "string",
        projectId: "string",
        path: "string",
        replace: false,
    });
    
    type: azuredevops:AreaPermissions
    properties:
        path: string
        permissions:
            string: string
        principal: string
        projectId: string
        replace: false
    

    AreaPermissions Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The AreaPermissions resource accepts the following input properties:

    Permissions Dictionary<string, string>
    the permissions to assign. The following permissions are available.
    Principal string
    The group principal to assign the permissions.
    ProjectId string
    The ID of the project to assign the permissions.
    Path string
    The name of the branch to assign the permissions.
    Replace bool

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    Permissions map[string]string
    the permissions to assign. The following permissions are available.
    Principal string
    The group principal to assign the permissions.
    ProjectId string
    The ID of the project to assign the permissions.
    Path string
    The name of the branch to assign the permissions.
    Replace bool

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    permissions Map<String,String>
    the permissions to assign. The following permissions are available.
    principal String
    The group principal to assign the permissions.
    projectId String
    The ID of the project to assign the permissions.
    path String
    The name of the branch to assign the permissions.
    replace Boolean

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    permissions {[key: string]: string}
    the permissions to assign. The following permissions are available.
    principal string
    The group principal to assign the permissions.
    projectId string
    The ID of the project to assign the permissions.
    path string
    The name of the branch to assign the permissions.
    replace boolean

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    permissions Mapping[str, str]
    the permissions to assign. The following permissions are available.
    principal str
    The group principal to assign the permissions.
    project_id str
    The ID of the project to assign the permissions.
    path str
    The name of the branch to assign the permissions.
    replace bool

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    permissions Map<String>
    the permissions to assign. The following permissions are available.
    principal String
    The group principal to assign the permissions.
    projectId String
    The ID of the project to assign the permissions.
    path String
    The name of the branch to assign the permissions.
    replace Boolean

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AreaPermissions resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AreaPermissions Resource

    Get an existing AreaPermissions resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AreaPermissionsState, opts?: CustomResourceOptions): AreaPermissions
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            path: Optional[str] = None,
            permissions: Optional[Mapping[str, str]] = None,
            principal: Optional[str] = None,
            project_id: Optional[str] = None,
            replace: Optional[bool] = None) -> AreaPermissions
    func GetAreaPermissions(ctx *Context, name string, id IDInput, state *AreaPermissionsState, opts ...ResourceOption) (*AreaPermissions, error)
    public static AreaPermissions Get(string name, Input<string> id, AreaPermissionsState? state, CustomResourceOptions? opts = null)
    public static AreaPermissions get(String name, Output<String> id, AreaPermissionsState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Path string
    The name of the branch to assign the permissions.
    Permissions Dictionary<string, string>
    the permissions to assign. The following permissions are available.
    Principal string
    The group principal to assign the permissions.
    ProjectId string
    The ID of the project to assign the permissions.
    Replace bool

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    Path string
    The name of the branch to assign the permissions.
    Permissions map[string]string
    the permissions to assign. The following permissions are available.
    Principal string
    The group principal to assign the permissions.
    ProjectId string
    The ID of the project to assign the permissions.
    Replace bool

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    path String
    The name of the branch to assign the permissions.
    permissions Map<String,String>
    the permissions to assign. The following permissions are available.
    principal String
    The group principal to assign the permissions.
    projectId String
    The ID of the project to assign the permissions.
    replace Boolean

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    path string
    The name of the branch to assign the permissions.
    permissions {[key: string]: string}
    the permissions to assign. The following permissions are available.
    principal string
    The group principal to assign the permissions.
    projectId string
    The ID of the project to assign the permissions.
    replace boolean

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    path str
    The name of the branch to assign the permissions.
    permissions Mapping[str, str]
    the permissions to assign. The following permissions are available.
    principal str
    The group principal to assign the permissions.
    project_id str
    The ID of the project to assign the permissions.
    replace bool

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    path String
    The name of the branch to assign the permissions.
    permissions Map<String>
    the permissions to assign. The following permissions are available.
    principal String
    The group principal to assign the permissions.
    projectId String
    The ID of the project to assign the permissions.
    replace Boolean

    Replace (true) or merge (false) the permissions. Default: true.

    | Permission | Description | |------------------------|--------------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node | | WORK_ITEM_READ | View work items in this node | | WORK_ITEM_WRITE | Edit work items in this node | | MANAGE_TEST_PLANS | Manage test plans | | MANAGE_TEST_SUITES | Manage test suites | | WORK_ITEM_SAVE_COMMENT | Edit work item comments in this node |

    Import

    The resource does not support import.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi