-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add Dataactions support for Roledefinition calls #5646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@maddieclayton should this PR be assigned to you? |
| ResourcesController.NewInstance.RunPsTest("Test-RDDataActionsNegativeTestCases"); | ||
| } | ||
|
|
||
| [Fact] |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to example.
There was a problem hiding this comment.
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())) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
maddieclayton
left a comment
There was a problem hiding this 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")] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"\] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"\] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating it
|
@darshanhs90 Once you fix the merge conflict that has come up, and fixed the text issue, I will merge this PR. |
raghukishor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
Currently waiting for the following pr to get completed
Azure/azure-sdk-for-net#4079
Description
Checklist
CONTRIBUTING.mdplatyPSmodule