Skip to content

Conversation

@darshanhs90
Copy link
Contributor

@darshanhs90 darshanhs90 commented Mar 1, 2018

Currently waiting for the following pr to get completed
Azure/azure-sdk-for-net#4079

Description

Checklist

@darshanhs90 darshanhs90 changed the title Add Dataactions support for Roledefinition calls Add Dataactions support for Roledefinition calls[Donot merge] Mar 1, 2018
@darshanhs90 darshanhs90 requested a review from shaosong2017 March 1, 2018 21:53
@darshanhs90 darshanhs90 removed the request for review from shaosong2017 March 7, 2018 07:43
@darshanhs90 darshanhs90 changed the title Add Dataactions support for Roledefinition calls[Donot merge] Add Dataactions support for Roledefinition calls Mar 7, 2018
@darshanhs90
Copy link
Contributor Author

@maddieclayton should this PR be assigned to you?

ResourcesController.NewInstance.RunPsTest("Test-RDDataActionsNegativeTestCases");
}

[Fact]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix formatting.

$badIdException = "RoleDefinitionDoesNotExist: The specified role definition with ID '" + $Rd.Id + "' does not exist."
Assert-Throws { Remove-AzureRmRoleDefinition -Id $Rd.Id -Scope $scope -Force -PassThru} $badIdException

return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverting it


1) NotActions: the set of operations that must be excluded from the Actions to determine the effective actions for the custom role.
If there is a specific operation that you do not wish to grant access to in a custom role, it is convenient to use NotActions to exclude it, rather than specifying all operations other than that specific operation in Actions.
2) DataActions: the set of data operations to which the custom role grants access.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this to the example below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Provide the updated role definition as an input to the command as a JSON file or a PSRoleDefinition object.
The role definition for the updated custom role MUST contain the Id and all other required properties of the role even if they are not updated: DisplayName, Description, Actions, AssignableScopes.
NotActions is optional.
NotActions, DataActions, NotDataActions are optional.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

if (roleDefinition.Actions == null || !roleDefinition.Actions.Any())
if ((roleDefinition.Actions == null || !roleDefinition.Actions.Any()) && (roleDefinition.DataActions == null || !roleDefinition.DataActions.Any()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause any scripts to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.
earlier the condition was if they had no value actions,it used to error out.
but now the condition is that if they dont have any value for actions and also no value for datactions,it will error out

Copy link
Contributor

@maddieclayton maddieclayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments

}

[Fact(Skip = "Unskip after service side change")]
[Fact(Skip = "Unskip after service side change")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you unskip this test now, or is this still waiting on other changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is still waiting for the changes

\[
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
\],
"AssignableScopes": \["/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f"\]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to xxxx format - this looks like a real subscription.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating it

\[
"Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write"
\],
"AssignableScopes": \["/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f"\]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to xxxx format as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating it

@maddieclayton
Copy link
Contributor

@darshanhs90 Once you fix the merge conflict that has come up, and fixed the text issue, I will merge this PR.

Copy link

@raghukishor raghukishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@maddieclayton
Copy link
Contributor

maddieclayton commented Mar 8, 2018

@maddieclayton maddieclayton merged commit 31629b2 into Azure:preview Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants