Class RoleAssignmentHelper
java.lang.Object
com.azure.resourcemanager.authorization.utils.RoleAssignmentHelper
A utility class to operate on role assignments for a resource with service principal (object id). This type is used
for internal implementations, client should not take dependency on this as the method signature and behaviour can
change in future releases.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA type that provide the service principal id (object id) and ARM resource id of the resource for which role assignments needs to be done. -
Constructor Summary
ConstructorsConstructorDescriptionRoleAssignmentHelper(AuthorizationManager authorizationManager, TaskGroup taskGroup, RoleAssignmentHelper.IdProvider idProvider) Creates RoleAssignmentHelper. -
Method Summary
Modifier and TypeMethodDescriptionwithAccessTo(String scope, BuiltInRole asRole) Specifies that applications running on an Azure service with this identity requires the given access role with scope of access limited to the ARM resource identified by the resource ID specified in the scope parameter.withAccessTo(String scope, String roleDefinitionId) Specifies that applications running on an Azure service with this identity requires the access described in the given role definition with scope of access limited to an ARM resource.Specifies that applications running on an Azure service with this identity requires the given access role with scope of access limited to the current resource group that the identity resides.withAccessToCurrentResourceGroup(String roleDefinitionId) Specifies that applications running on an Azure service with this identity requires the given access role with scope of access limited to the current resource group that the identity resides.withoutAccessTo(RoleAssignment roleAssignment) Specifies that an access role assigned to the identity should be removed.withoutAccessTo(String scope, BuiltInRole asRole) Specifies that an access role assigned to the identity should be removed.
-
Constructor Details
-
RoleAssignmentHelper
public RoleAssignmentHelper(AuthorizationManager authorizationManager, TaskGroup taskGroup, RoleAssignmentHelper.IdProvider idProvider) Creates RoleAssignmentHelper.- Parameters:
authorizationManager- the graph rbac managertaskGroup- the pre-run task group after which role assignments create/remove tasks should runidProvider- the provider that provides service principal id and resource id
-
-
Method Details
-
withAccessToCurrentResourceGroup
Specifies that applications running on an Azure service with this identity requires the given access role with scope of access limited to the current resource group that the identity resides.- Parameters:
asRole- access role to assigned to the identity- Returns:
- RoleAssignmentHelper
-
withAccessTo
Specifies that applications running on an Azure service with this identity requires the given access role with scope of access limited to the ARM resource identified by the resource ID specified in the scope parameter.- Parameters:
scope- scope of the access represented in ARM resource ID formatasRole- access role to assigned to the identity- Returns:
- RoleAssignmentHelper
-
withAccessToCurrentResourceGroup
Specifies that applications running on an Azure service with this identity requires the given access role with scope of access limited to the current resource group that the identity resides.- Parameters:
roleDefinitionId- access role definition to assigned to the identity- Returns:
- RoleAssignmentHelper
-
withAccessTo
Specifies that applications running on an Azure service with this identity requires the access described in the given role definition with scope of access limited to an ARM resource.- Parameters:
scope- scope of the access represented in ARM resource ID formatroleDefinitionId- access role definition to assigned to the identity- Returns:
- RoleAssignmentHelper
-
withoutAccessTo
Specifies that an access role assigned to the identity should be removed.- Parameters:
roleAssignment- a role assigned to the identity- Returns:
- RoleAssignmentHelper
-
withoutAccessTo
Specifies that an access role assigned to the identity should be removed.- Parameters:
scope- the scope of the role assignmentasRole- the role of the role assignment- Returns:
- RoleAssignmentHelper
-