Use the security settings in PowerTable to control access to data stored in a database. You can configure data security by using one of the following security models:

Roles & Policies Security - Configure database-level security by using policies, rules, roles, and user attributes.

When Roles & Policies Security is enabled, it overrides the settings configured through Manage Access (Legacy).
To choose a security model:
Select Security from the toolbar.

Select a SQL database to choose a security model and configure it.

Use Manage Access (Legacy) to configure row-level and column-level permissions for individual tables from Setup > Manage Access. To learn more, see manage access.
When Roles & Policies Security is enabled, the Manage Access settings become inactive, and PowerTable displays a notification indicating that access is controlled through the configured security policies.

Enable Roles & Policies Security to secure all tables in the selected database through reusable policies. By default, databases grant full access. To restrict access, create one or more policies, attach them to roles, and then assign the roles to users.
Policies are configured separately for each database. Security policies created for one database apply only to that database and don't affect other databases in the same item.

A policy groups one or more rules that define how users can access database tables.
To create a policy:
Enter a policy name, and then select Add Policy.

Rules determine the CRUD operations that users can perform on a selected table.
To create a rule:
Select Add Rule within a policy.

Select Save Changes to add the rule.

The permissions and rules behave as follows:
The Insert permission can't be combined with Read, Update, or Delete in the same rule. When Insert is selected, the remaining permissions and rule configuration options are disabled, and a warning message is displayed.

PowerTable prevents duplicate permission combinations for the same table within a policy. If a rule with the same permission set already exists for the selected table, an error message is displayed.

Configure one or more conditions to define the records that the selected rule applies to.
The rule configuration provides the following options:
Configure User Attributes to eliminate manual configuration of attribute values and dynamically retrieve values from related tables.
Enable Bypass Mode to grant unrestricted access to all tables in the selected database.
When Bypass Mode is enabled:
You can use Bypass Mode for administrative or manager roles that require unrestricted access to the database. Because it bypasses all row-level security rules, assign this policy only to trusted users.

User attributes dynamically retrieve values from related tables and use them to evaluate policy rules. This eliminates the need to manually specify attribute values in each policy rule.
To create a user attribute:
Select Add Attribute. The Configure User Attribute pane opens.

Select Save Changes.

Instead of entering values manually, you can make policy rules dynamic by using configured User Attributes.
To attach a user attribute in a rule:
In the Value box, select the + icon and choose the required user attribute.

The configured User Attribute returns the list of ProductSubcategoryKey values assigned to UserID 1012 from the UserProductAccess table. This user attribute is used as the value in the policy rule to filter the Product table and return only the products whose ProductSubcategoryKey matches the values returned by the user attribute.
In this example, ProductSubcategoryKey values 33 and 37 are assigned to UserID 1012. When this policy is attached to a role and the role is assigned to users, they can access only the products with ProductSubcategoryKey values 33 and 37.

The example in the previous section assigns access based on a specific UserID. As a result, every user who is assigned a role with the attached policy receives access to the same set of product records. To provide dynamic access for each user, configure the user attribute to use the Logged in User condition.
To provide dynamic access:
Select Save Changes.

Attach the user attribute to a policy rule.

When this policy is attached to a role and the role is assigned to users, PowerTable retrieves the ProductSubcategoryKey values associated with the signed-in user's email address from the UserProductAccess table. The policy rule uses these returned values to filter the Product table, allowing each user to access only the products assigned to them.
The following example shows the UserProductAccess table configured with the user to subcategory mappings. In this example, the signed-in user is Andzelika Juskaite.

When Andzelika Juskaite signs in, PowerTable retrieves the assigned ProductSubcategoryKey values (25, 28, and 32) and uses the attached policy to filter the Product table. As a result, only the products belonging to these subcategories are accessible.

When the user attribute is configured with the Multiple return type, only the Is one of and Is not one of operators are supported.
Security roles define the permissions available to a group of users. Create multiple roles to provide different levels of access based on user responsibilities. After creating a role, assign it to one or more users.
After creating one or more policies, attach them to a role to control user access. You can attach multiple policies to a single role.
To create a role and attach policies:
Enter a Role Name, and then select Add.

Select Save Changes.

To rename a role:
Renaming a role updates only its name. The configured permissions remain unchanged.
To delete a role:
Confirm the deletion.

The Item Baseline role is the default system role and cannot be renamed or deleted.
The General tab controls access to all sheets in the item for the selected role. Each sheet is listed individually, allowing you to configure its visibility and editing permissions.

Select the role on the left. Then, for every sheet, set the following permissions:
| Permission | Description |
|---|---|
| Visible | Determines whether the sheet is visible to users assigned to the selected role. Disable this option to hide the sheet from users. |
| Read Only | Allows users to view the sheet but prevents them from making changes. Disable this option to allow users to edit the sheet. |
By default, you can view and edit all sheets for the selected role. You can configure individual sheets to hide them or make them read-only as required.
Enable the Visible toggle to make the sheet available to users. If you disable the Visible toggle, users can't access the sheet regardless of the Read Only setting.
The Item Baseline role is the default role and grants full access to all users. To restrict the default access, configure the required sheet permissions in the General tab, and then enable Restrict with Policy and attach one or more policies in the PowerTable tab.

Users who aren't assigned another role inherit the permissions configured for the Item Baseline role. If a user is assigned additional roles, the permissions configured for those roles determine the user's effective access.
Assign the configured roles to users. Users inherit the policies attached to their assigned roles.
To assign roles to users:
Select Add.

If a user is assigned multiple roles for the same table or database, the role and policy that provide the highest level of access take precedence.