You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/power-platform/power-apps/dataverse/cleanup-inherited-access.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: How to clean up inherited access
3
-
description: Introduces how to remove inherited access for records when the cascade configuration of a table changes in Microsoft Power Apps.
3
+
description: Introduces how to remove inherited access to records when the cascade configuration of a table changes in Microsoft Power Apps.
4
4
ms.date: 09/07/2023
5
5
author: paulliew
6
6
ms.author: paulliew
@@ -21,26 +21,26 @@ This article introduces how to remove inherited access for records when the casc
21
21
22
22
## Symptoms
23
23
24
-
After the [cascading behavior of a table relationship](/power-apps/developer/data-platform/configure-entity-relationship-cascading-behavior#reset-cascade-inherited-access) for the **Reparent** or **Share**actions is changed to **No Cascade**, users continue to have access to related records that should be removed.
24
+
After the [cascading behavior of a table relationship](/power-apps/developer/data-platform/configure-entity-relationship-cascading-behavior#reset-cascade-inherited-access) for the **Reparent** or **Share**action is changed to **No Cascade**, you continue to have access to the related records that should be removed.
25
25
26
26
## How to verify the access to related records
27
27
28
-
Users may report that they have unexpected access to records. There are two ways to verify the access to related records:
28
+
When you find that you have unexpected access to records, you can use the **Check Access** feature or the `RetrieveAccessOrigin message`to verify the access to the related records.
29
29
30
30
#### Use the Check Access feature
31
31
32
-
Use the [Check Access](/power-apps/user/access-checker) in model-driven apps to check who has access to a record. Administrators can use this feature to check individual users or all users who have access to a record.
32
+
Use the [Check Access](/power-apps/user/access-checker)feature in model-driven apps to check who has access to a record. Administrators can use this feature to check individual users or all users who have access to a record.
33
33
34
34
When using the access checker, you see a list of reasons why a user has access. Some of these reasons indicate that the sharing was granted due to access to a related record. For example:
35
35
36
36
- Record was shared with me because I have access to related record.
37
-
- Record was shared with a team(s) that I'm a member of because the team has access to related record.
37
+
- Record was shared with team(s) that I'm a member of because the team has access to related record.
38
38
39
39
#### Use the RetrieveAccessOrigin message
40
40
41
-
Developers can use the `RetrieveAccessOrigin` message to detect which users have access to a record. This message returns a sentence describing why the user has the access. Any of following results indicate that the access was granted due to the sharing of a related record:
41
+
Developers can use the `RetrieveAccessOrigin` message to detect which users have access to a record. This message returns a sentence describing why the user has the access. Any of the following results indicate that the access was granted due to the sharing of a related record:
42
42
43
-
```console
43
+
```output
44
44
PrincipalId is owner of a parent entity of object (<record ID>)
45
45
PrincipalId is member of team (<team ID>) who is owner of a parent entity of object (<record ID>)
46
46
PrincipalId is member of organization (<organization ID>) who is owner of a parent entity of object (<record ID>)
@@ -51,15 +51,15 @@ For more information, see [Determine why a user has access with code](/power-app
51
51
52
52
## Cause
53
53
54
-
When the cascading behavior for a table relationship changes, Dataverse starts an asynchronous job to remove the access users were previously granted. However, this job may fail, which could result in users retaining access.
54
+
When the cascading behavior for a table relationship changes, Dataverse starts an asynchronous job to remove the access users were previously granted. However, this job may fail, resulting in users retaining access.
55
55
56
56
## Resolution
57
57
58
-
The first step to resolve this issue is to recreate the system job to remove access. If the job fails, a developer can use the `ResetInheritedAccess` message to apply the change for a specified set of records.
58
+
The first step to resolve this issue is to recreate the system job to remove access. If the job fails, a developer can use the `ResetInheritedAccess` message to apply the change to a specified set of records.
59
59
60
60
### Recreate the system job to remove access
61
61
62
-
Developers can use the `CreateAsyncJobToRevokeInheritedAccess` message to try creating the asynchronous job again.
62
+
Developers can use the `CreateAsyncJobToRevokeInheritedAccess` message to try creating an asynchronous job again.
63
63
64
64
#### [SDK for .NET](#tab/sdk)
65
65
@@ -113,11 +113,11 @@ OData-Version: 4.0
113
113
114
114
---
115
115
116
-
The `CreateAsyncJobToRevokeInheritedAccess` action creates a new asynchronous job named "RevokeInheritedAccess". You can monitor the success of this job. For more information, see [monitoring system jobs](/power-platform/admin/manage-dataverse-auditing#monitoring-system-jobs) or [managing system jobs with code](/power-apps/developer/data-platform/asynchronous-service#managing-system-jobs).
116
+
The `CreateAsyncJobToRevokeInheritedAccess` action creates a new asynchronous job named `RevokeInheritedAccess`. You can monitor the success of this job. For more information, see [monitoring system jobs](/power-platform/admin/manage-dataverse-auditing#monitoring-system-jobs) or [managing system jobs with code](/power-apps/developer/data-platform/asynchronous-service#managing-system-jobs).
117
117
118
118
### Reset inherited access
119
119
120
-
If [Recreating the system job to remove access](#recreate-the-system-job-to-remove-access) fails, a developer with system administrator or system customizer privileges can use the `ResetInheritedAccess` message to target a subset of matching records. You may need to use this message several times to remove access for all the records.
120
+
If [recreating the system job to remove access](#recreate-the-system-job-to-remove-access) fails, a developer with system administrator or system customizer privileges can use the `ResetInheritedAccess` message to target a subset of matching records. You may need to use this message several times to remove access to all the records.
121
121
122
122
# [SDK for .NET](#tab/sdk)
123
123
@@ -177,49 +177,49 @@ OData-Version: 4.0
177
177
178
178
The `ResetInheritedAccess` message tries to execute synchronously when there aren't many matching records. Then the `ResetInheritedAccessResponse` value ends with `ExecutionMode : Sync`. If there are many matching records, the operation takes longer, and the value ends with `ExecutionMode : Async`. A system job named `Denormalization_PrincipalObjectAccess_principalobjectaccess:<caller ID>` is created, and you can monitor the success of that job. For more information, see [monitoring system jobs](/power-platform/admin/manage-dataverse-auditing#monitoring-system-jobs) or [managing system jobs with code](/power-apps/developer/data-platform/asynchronous-service#managing-system-jobs).
179
179
180
-
The `ResetInheritedAccess` message requires a Fetch query to identify the records. This query must meet the following requirements:
180
+
The `ResetInheritedAccess` message requires a `Fetch` query to identify the records. This query must meet the following requirements:
181
181
182
182
- Use the `principalobjectaccess`(POA) table.
183
183
- Return only the `principalobjectaccessid` column.
184
184
- Must not include any `link-entity` elements. You can't add a join to another table.
185
185
- Only filter on columns of the `principalobjectaccess` table.
186
186
187
-
This table is available to the Web API as the [principalobjectaccess entity type](xref:Microsoft.Dynamics.CRM.principalobjectaccess). It isn't included in the [Dataverse table/entity reference](/power-apps/developer/data-platform/reference/about-entity-reference) because the POA table doesn't support any kind of direct data modification operation. You need to know about the columns of this table to compose the FetchXml query.
187
+
This table is available to the Web API as the [principalobjectaccess entity type](xref:Microsoft.Dynamics.CRM.principalobjectaccess). It isn't included in the [Dataverse table/entity reference](/power-apps/developer/data-platform/reference/about-entity-reference) because the POA table doesn't support any kind of direct data modification operation. You need to know the columns of this table to compose the FetchXml query.
188
188
189
189
#### POA table columns
190
190
191
191
You need to compose a FetchXml query using only these columns.
192
192
193
-
|LogicalName|Type|Description|
193
+
|Logical name|Type|Description|
194
194
|---------|---------|---------|
195
195
|`accessrightsmask`|Integer|Contains the combined [AccessRights enum](xref:Microsoft.Dynamics.CRM.AccessRights) member values for the access rights that the principal has directly. |
196
196
|`changedon`|DateTime|The last date that the principal's access to the record changed.|
197
197
|`inheritedaccessrightsmask`|Integer|Contains the combined [AccessRights enum](xref:Microsoft.Dynamics.CRM.AccessRights) member values for the access rights that are applied due to inheritance.|
198
198
|`objectid`|Unique Identifier|The ID of the record that the principal has access to.|
199
-
|`objecttypecode`|Integer|The [EntityMetadata.ObjectTypeCode](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.ObjectTypeCode) value that corresponds to the table. This value isn't necessarily the same for different environments. For custom tables, it's assigned based on the order the table was created. To get this value, you may need to view the metadata for the table. There are several community tools to find this. There's a solution from Microsoft: [Browse table definitions in your environment](/power-apps/developer/data-platform/browse-your-metadata).|
200
-
|`principalid`|Unique Identifier|The ID of the user or team who has access.|
199
+
|`objecttypecode`|Integer|The [EntityMetadata.ObjectTypeCode](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.ObjectTypeCode) value that corresponds to the table. This value isn't necessarily the same for different environments. For custom tables, it's assigned based on the order in which the table was created. To get this value, you may need to view the metadata for the table. There are several community tools to find this. Here's a solution from Microsoft: [Browse table definitions in your environment](/power-apps/developer/data-platform/browse-your-metadata).|
200
+
|`principalid`|Unique Identifier|The ID of the user or team that has access.|
201
201
|`principalobjectaccessid`|Unique Identifier|The primary key of the POA table.|
202
202
|`principaltypecode`|Integer|The type code of the principal. `SystemUser` = 8, `Team` = 9.|
203
203
204
-
The following [AccessRights enum](xref:Microsoft.Dynamics.CRM.AccessRights) member values apply for the `accessrightsmask` and `inheritedaccessrightsmask` columns:
204
+
The following [AccessRights enum](xref:Microsoft.Dynamics.CRM.AccessRights) member values apply to the `accessrightsmask` and `inheritedaccessrightsmask` columns:
205
205
206
206
|Access type|Value|Description|
207
207
|---------|---------|---------|
208
-
|None|0|No access.|
209
-
|Read|1|The right to read a record.|
210
-
|Write|2|The right to update a record.|
211
-
|Append|4|The right to append the specified record to another record. |
212
-
|AppendTo|16|The right to append another record to the specified record. |
213
-
|Create|32|The right to create a record.|
214
-
|Delete|65,536|The right to delete a record.|
215
-
|Share|262,144|The right to share a record.|
216
-
|Assign|524,288|The right to assign the specified record to another user or team.|
217
-
218
-
You may see that the `inheritedaccessrightsmask` value is commonly 135,069,719. This value includes all the access types except for create, which isn't necessary because these rights only apply to records already created.
208
+
|`None`|0|No access.|
209
+
|`Read`|1|The right to read a record.|
210
+
|`Write`|2|The right to update a record.|
211
+
|`Append`|4|The right to append the specified record to another record. |
212
+
|`Append`To|16|The right to append another record to the specified record. |
213
+
|`Create`|32|The right to create a record.|
214
+
|`Delete`|65,536|The right to delete a record.|
215
+
|`Share`|262,144|The right to share a record.|
216
+
|`Assign`|524,288|The right to assign the specified record to another user or team.|
217
+
218
+
You may see that the `inheritedaccessrightsmask` value is commonly 135,069,719. This value includes all the access types except for `Create`, which isn't necessary because these rights only apply to records already created.
219
219
220
220
#### FetchXml examples
221
221
222
-
This section includes some example FetchXml queries you might use with the `ResetInheritedAccess` message. [Learn more about creating FetchXml queries](/power-apps/developer/data-platform/use-fetchxml-construct-query).
222
+
This section includes some examples of FetchXml queries you might use with the `ResetInheritedAccess` message. For more information, see [Use FetchXML to construct a query](/power-apps/developer/data-platform/use-fetchxml-construct-query).
223
223
224
224
##### Reset inherited access given to a certain user for a specific account
0 commit comments