|
| 1 | +--- |
| 2 | +title: Tutorial - configure table permissions using portals Studio (Preview) |
| 3 | +description: This article walks through a scenario with step-by-step example about how to configure security by using table permissions for a portal using Power Apps portals Studio. |
| 4 | +author: tapanm-msft |
| 5 | +ms.service: powerapps |
| 6 | +ms.topic: conceptual |
| 7 | +ms.custom: |
| 8 | +ms.date: 04/21/2021 |
| 9 | +ms.author: ckwan |
| 10 | +ms.reviewer: tapanm |
| 11 | +contributors: |
| 12 | + - tapanm-msft |
| 13 | +--- |
| 14 | + |
| 15 | +# Tutorial: Configure table permissions using portals Studio (Preview) |
| 16 | + |
| 17 | +[This article is pre-release documentation and is subject to change.] |
| 18 | + |
| 19 | +In the previous article, you learned about how to configure security in portals by using table permissions configuration from Power Apps portals Studio. In this article, you'll learn about configuring the table permissions using Power Apps portals Studio with a sample scenario and step-by-step tutorial. |
| 20 | + |
| 21 | +The goal of using this scenario is to show how to use portals Studio to configure table permissions with real-world case study. The scenario showcases using each [access type available in portals Studio](entity-permissions-studio.md#available-access-types-in-studio) to match the real-world scenario with a business requirement with the relevant Microsoft Dataverse tables, and table relationships. |
| 22 | + |
| 23 | +> [!IMPORTANT] |
| 24 | +> - This is a preview feature. |
| 25 | +> - [!INCLUDE[cc_preview_features_definition](../../../includes/cc-preview-features-definition.md)] |
| 26 | +
|
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +Before you begin with this scenario, understand how to use Power Apps portals Studio to configure table permissions. You'll also need a portal, and access to the Dataverse environment. |
| 30 | + |
| 31 | +> [!NOTE] |
| 32 | +> This tutorial does not include configuration of web pages, basic or advanced forms, or Dataverse tables. The focus of this tutorial is configuration of table permissions using Studio. To create pages and customize them, see [Build portals using portals Studio](../portal-designer-anatomy.md). To create and configure tables in Dataverse, see [Tables in Dataverse](../../data-platform/entity-overview.md). |
| 33 | +
|
| 34 | +## Scenario |
| 35 | + |
| 36 | +For this tutorial scenario, consider an example of Contoso Limited that deals with buying and selling used cars. Contoso has a B2B (business-to-business) portal to manage the inventory posted by sales staff at the car dealerships across the country. |
| 37 | + |
| 38 | +### Roles |
| 39 | + |
| 40 | +Contoso has the following web roles available. |
| 41 | + |
| 42 | +- **Authenticated users** - default role for all authenticated users. |
| 43 | +- **Anonymous users** - default role for all anonymous users. |
| 44 | +- **Admin** - IT Administrators for Contoso. |
| 45 | +- **Sales** - Sales staff to manage car sales across dealerships. |
| 46 | +- **Managers** - Managers of the sales and dealership staff. |
| 47 | + |
| 48 | +### Tables |
| 49 | + |
| 50 | +Contoso uses the following Dataverse tables for this configuration. |
| 51 | + |
| 52 | +- **Car listings** - contains listings of all cars in Contoso inventory across all dealerships. |
| 53 | +- **Dealerships** - contains details about all car dealerships along with the address and inventory summary. |
| 54 | + |
| 55 | +Along with the above tables, this scenario also uses existing tables such as **Contact**, and **Account**. |
| 56 | + |
| 57 | +### Relationships |
| 58 | + |
| 59 | +Contoso has the following relationships configured between tables in Dataverse. |
| 60 | + |
| 61 | +- **Account (One) to Dealerships (Many)** - One account can own multiple dealerships. |
| 62 | +- **Contact (One) to Car listings (Many)** - One sales staff (contact) can have multiple car listings. |
| 63 | +- **Dealership (One) to Car listings (Many)** - One dealership can have multiple car listings. |
| 64 | + |
| 65 | +### Customizations |
| 66 | + |
| 67 | +Contoso has the following customizations configured for this scenario. |
| 68 | + |
| 69 | +- Web pages have table permissions enabled. More information: [Manage page permissions](webpage-access-control.md) |
| 70 | +- Web pages have [lists](entity-lists.md) configured with the tables, views, and the ability to create/view/edit/delete records as appropriate. |
| 71 | + - To show [all car listings to all authenticated users](#view-all-car-listings), the web page has list with a view from the **Car listings** table with only View record permission. |
| 72 | + - To show, update, and delete [owned car listings](#view-update-and-delete-owned-car-listings), the web page has list with a view from the **Car listings** table having View, Create, Edit, and Delete records permissions. |
| 73 | + - To show [all car dealerships](#view-all-car-dealerships), the web page has list with a view from the **Dealerships** table having View, Create, Edit, and Delete records permissions. |
| 74 | + - To show [car listings for an associated dealership](#view-car-listings-for-associated-dealership), the web page has a list with a view from the **Dealerships** table. This list can be used to view the dealership details, with view having subgrid that shows the car listings associated to the selected dealership with View, Create, Edit, and delete records permissions. |
| 75 | + |
| 76 | +## View all car listings |
| 77 | + |
| 78 | +Contoso has a web page with a basic form that shows all current car listings in the inventory to all authenticated users. |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +To configure table permissions for global access to all authenticated users: |
| 83 | + |
| 84 | +1. Sign in to [Power Apps](https://make.powerapps.com). |
| 85 | + |
| 86 | +1. Select **Apps** on the left-pane. |
| 87 | + |
| 88 | +1. Select your portal. |
| 89 | + |
| 90 | +1. Select **Edit** to open portals Studio. |
| 91 | + |
| 92 | +1. Select **Settings** (:::image type="icon" source="media/entity-permissions-studio/settings.png":::) on the left pane inside portals Studio. |
| 93 | + |
| 94 | +1. Select **Table permissions**. |
| 95 | + |
| 96 | +1. Select **New permission**. |
| 97 | + |
| 98 | +1. Enter table permission name as "All available cars". |
| 99 | + |
| 100 | +1. Select **Car listings** table. |
| 101 | + |
| 102 | +1. Select **Global access** for access type. |
| 103 | + |
| 104 | +1. Select **Read** privilege. |
| 105 | + |
| 106 | +1. Select **Add roles**. |
| 107 | + |
| 108 | +1. From the list of available roles, select **Authenticated users**. |
| 109 | + |
| 110 | +  |
| 111 | + |
| 112 | +1. Select **Save**. |
| 113 | + |
| 114 | +## View, update and delete owned car listings |
| 115 | + |
| 116 | +Contoso has a web page with a basic form that allows sales staff to view, update, and delete car listings that they have created. |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | +To configure table permissions for contact access to owning sales staff: |
| 121 | + |
| 122 | +1. Sign in to [Power Apps](https://make.powerapps.com). |
| 123 | + |
| 124 | +1. Select **Apps** on the left-pane. |
| 125 | + |
| 126 | +1. Select your portal. |
| 127 | + |
| 128 | +1. Select **Edit** to open portals Studio. |
| 129 | + |
| 130 | +1. Select **Settings** (:::image type="icon" source="media/entity-permissions-studio/settings.png":::) on the left pane inside portals Studio. |
| 131 | + |
| 132 | +1. Select **Table permissions**. |
| 133 | + |
| 134 | +1. Select **New permission**. |
| 135 | + |
| 136 | +1. Enter table permission name as "Cars associated to sales role". |
| 137 | + |
| 138 | +1. Select **Car listings** table. |
| 139 | + |
| 140 | +1. Select **Contact access** as the access type. |
| 141 | + |
| 142 | +1. Select relationship between the Contact, and the Car listings table. |
| 143 | + |
| 144 | +1. Select **Read**, **Write**, **Create**, and **Delete** privileges. |
| 145 | + |
| 146 | +1. Select **Add roles**. |
| 147 | + |
| 148 | +1. From the list of available roles, select **Sales**. |
| 149 | + |
| 150 | +  |
| 151 | + |
| 152 | +1. Select **Save**. |
| 153 | + |
| 154 | +## View all car dealerships |
| 155 | + |
| 156 | +Contoso has a web page with a basic form that allows sales staff to view all the car dealerships owned by their company. |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | +To configure table permissions for account access to sales staff for dealerships: |
| 161 | + |
| 162 | +1. Sign in to [Power Apps](https://make.powerapps.com). |
| 163 | + |
| 164 | +1. Select **Apps** on the left-pane. |
| 165 | + |
| 166 | +1. Select your portal. |
| 167 | + |
| 168 | +1. Select **Edit** to open portals Studio. |
| 169 | + |
| 170 | +1. Select **Settings** (:::image type="icon" source="media/entity-permissions-studio/settings.png":::) on the left pane inside portals Studio. |
| 171 | + |
| 172 | +1. Select **Table permissions**. |
| 173 | + |
| 174 | +1. Select **New permission**. |
| 175 | + |
| 176 | +1. Enter table permission name as "Cars dealerships owned by company". |
| 177 | + |
| 178 | +1. Select **Dealerships** table. |
| 179 | + |
| 180 | +1. Select **Account access** as the access type. |
| 181 | + |
| 182 | +1. Select relationship between the Account, and the Dealerships table. |
| 183 | + |
| 184 | +1. Select **Read** privilege. |
| 185 | + |
| 186 | +1. Select **Add roles**. |
| 187 | + |
| 188 | +1. From the list of available roles, select **Sales**. |
| 189 | + |
| 190 | +  |
| 191 | + |
| 192 | +1. Select **Save**. |
| 193 | + |
| 194 | +## View car listings for associated dealership |
| 195 | + |
| 196 | +Contoso has a web page with a basic form that allows sales staff to view car listings from the dealerships that the sales staff is associated to. |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | +To configure table permissions for sales staff to view associated dealership's car listings: |
| 201 | + |
| 202 | +1. Sign in to [Power Apps](https://make.powerapps.com). |
| 203 | + |
| 204 | +1. Select **Apps** on the left-pane. |
| 205 | + |
| 206 | +1. Select your portal. |
| 207 | + |
| 208 | +1. Select **Edit** to open portals Studio. |
| 209 | + |
| 210 | +1. Select **Settings** (:::image type="icon" source="media/entity-permissions-studio/settings.png":::) on the left pane inside portals Studio. |
| 211 | + |
| 212 | +1. Select **Table permissions**. |
| 213 | + |
| 214 | +1. Select **Car dealerships owned by company** table permission created earlier. |
| 215 | + |
| 216 | +1. Select **Add child permission**. |
| 217 | + |
| 218 | +1. Enter table permission name as "Cars in dealerships". |
| 219 | + |
| 220 | +1. Select **Car listings** table. |
| 221 | + |
| 222 | +1. Select relationship between the Dealerships, and the Car listings table. |
| 223 | + |
| 224 | +1. Select **Read** privilege. |
| 225 | + |
| 226 | +1. From the list of available roles, select **Sales**. |
| 227 | + |
| 228 | +  |
| 229 | + |
| 230 | + > [!NOTE] |
| 231 | + > **Sales** role is inherited from the parent table permission. |
| 232 | +
|
| 233 | +1. Select **Save**. |
| 234 | + |
| 235 | +## Summary |
| 236 | + |
| 237 | +Now that you have all the table permissions configured, this is how the permissions look like inside portals Studio. |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | +- **All available cars** - This table permission allows all authenticated users to view all car listings across all dealerships using **Global access** access type. |
| 242 | +- **Cars associated to sales role** - This table permission allows each sales staff to view the car listings created by themselves using **Contact access** access type. |
| 243 | +- **Car dealerships owned by company** - This table permission allows sales staff to view all dealerships across the company using **Account access** access type. |
| 244 | +- **Cars in dealerships** - This child permission with is associated to the **Car dealerships owned by company** table permission. And allows sales staff to view car listings associated to their assigned dealership using **Associated access** access type (through child permission). |
| 245 | + |
| 246 | +This scenario explained how to configure table permissions in a real-world scenario to achieve business goals. You can now use the learnings from this tutorial to configure table permissions for your portal to meet your business requirements. |
| 247 | + |
| 248 | +### See also |
| 249 | + |
| 250 | +[Assign table permissions](assign-entity-permissions.md) <br> |
| 251 | +[Table permissions using portals Studio](entity-permissions-studio.md) |
0 commit comments