Class Role
With this resource, you can created and manage collections of permissions that can be assigned to users, which are otherwise known as roles. Permissions (scopes) are created on auth0_resource_server, then associated with roles and optionally, users using this resource.
Example Usage
using Pulumi;
using Auth0 = Pulumi.Auth0;
class MyStack : Stack
{
public MyStack()
{
var myResourceServer = new Auth0.ResourceServer("myResourceServer", new Auth0.ResourceServerArgs
{
EnforcePolicies = true,
Identifier = "my-resource-server-identifier",
Scopes =
{
new Auth0.Inputs.ResourceServerScopeArgs
{
Description = "read something",
Value = "read:something",
},
},
SigningAlg = "RS256",
SkipConsentForVerifiableFirstPartyClients = true,
TokenLifetime = 86400,
});
var myRole = new Auth0.Role("myRole", new Auth0.RoleArgs
{
Description = "Role Description...",
Permissions =
{
new Auth0.Inputs.RolePermissionArgs
{
Name = "read:something",
ResourceServerIdentifier = myResourceServer.Identifier,
},
},
});
var myUser = new Auth0.User("myUser", new Auth0.UserArgs
{
ConnectionName = "Username-Password-Authentication",
Email = "test@test.com",
Nickname = "testnick",
Password = "passpass$$12$$12",
Roles =
{
myRole.Id,
},
UserId = "auth0|1234567890",
Username = "testnick",
});
}
}
Inheritance
Inherited Members
Namespace: Pulumi.Auth0
Assembly: Pulumi.Auth0.dll
Syntax
public class Role : CustomResource
Constructors
View SourceRole(String, RoleArgs, CustomResourceOptions)
Create a Role resource with the given unique name, arguments, and options.
Declaration
public Role(string name, RoleArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RoleArgs | args | The arguments used to populate this resource's properties |
| Pulumi.CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDescription
String. Description of the role.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Pulumi.Output<System.String> |
Name
String. Name for this role.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Pulumi.Output<System.String> |
Permissions
Set(Resource). Configuration settings for permissions (scopes) attached to the role. For details, see Permissions.
Declaration
public Output<ImmutableArray<RolePermission>> Permissions { get; }
Property Value
| Type | Description |
|---|---|
| Pulumi.Output<System.Collections.Immutable.ImmutableArray<RolePermission>> |
Methods
View SourceGet(String, Input<String>, RoleState, CustomResourceOptions)
Get an existing Role resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Role Get(string name, Input<string> id, RoleState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Pulumi.Input<System.String> | id | The unique provider ID of the resource to lookup. |
| RoleState | state | Any extra arguments used during the lookup. |
| Pulumi.CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Role |