Skip to content

Commit 05be958

Browse files
committed
Additional changes for RoleAssignments
1 parent 13a8f10 commit 05be958

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClientExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public static PSRoleAssignment ToPSRoleAssignment(this ClassicAdministrator clas
128128
{
129129
RoleDefinitionName = classicAdministrator.Properties.Role,
130130
DisplayName = classicAdministrator.Properties.EmailAddress,
131+
SignInName = classicAdministrator.Properties.EmailAddress,
131132
Scope = "/subscriptions/" + currentSubscriptionId,
132133
ObjectType = "User"
133134
};

src/ResourceManager/Resources/Commands.Resources/RoleAssignments/NewAzureRoleAssignmentCommand.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.Resources
2323
/// <summary>
2424
/// Creates new role assignment.
2525
/// </summary>
26-
[Cmdlet(VerbsCommon.New, "AzureRmRoleAssignment"), OutputType(typeof(PSRoleAssignment))]
26+
[Cmdlet(VerbsCommon.New, "AzureRmRoleAssignment", DefaultParameterSetName = ParameterSet.Empty), OutputType(typeof(PSRoleAssignment))]
2727
public class NewAzureRoleAssignmentCommand : ResourcesBaseCmdlet
2828
{
2929
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ResourceGroupWithObjectId,
@@ -32,6 +32,8 @@ public class NewAzureRoleAssignmentCommand : ResourcesBaseCmdlet
3232
HelpMessage = "The user or group object id.")]
3333
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ScopeWithObjectId,
3434
HelpMessage = "The user or group object id.")]
35+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.Empty,
36+
HelpMessage = "The user or group object id.")]
3537
[ValidateNotNullOrEmpty]
3638
[Alias("Id", "PrincipalId")]
3739
public Guid ObjectId { get; set; }
@@ -98,6 +100,8 @@ public class NewAzureRoleAssignmentCommand : ResourcesBaseCmdlet
98100
[ValidateNotNullOrEmpty]
99101
public string ParentResource { get; set; }
100102

103+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.Empty,
104+
HelpMessage = "Scope of the role assignment. In the format of relative URI. If not specified, will assign the role at subscription level. If specified, it can either start with \"/subscriptions/<id>\" or the part after that. If it's latter, the current subscription id will be used.")]
101105
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ScopeWithObjectId,
102106
HelpMessage = "Scope of the role assignment. In the format of relative URI. If not specified, will assign the role at subscription level. If specified, it can either start with \"/subscriptions/<id>\" or the part after that. If it's latter, the current subscription id will be used.")]
103107
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ScopeWithSignInName,

0 commit comments

Comments
 (0)