Creating Permissions

In this lesson, you will learn how to create permissions for your application.

Creating Permissions

You can use permissions to restrict access to certain parts of an application, such as restricting access to a screen that can modify data. For example, a payroll application can allow an employee to view, but not change, their payroll information. But a payroll supervisor has permission to view and change any employee information. You can define permissions that allow the supervisor to have more access.

To create a permission

  1. In Solution Explorer, double-click the Properties node.

    The Application Designer appears.

  2. In the Application Designer, click the Access Control tab.

  3. In the Define permissions or select permissions to use for debugging grid, click <Add New Permission>, and then type Can_View_Products.

  4. In the Display Name column, type View Products.

  5. In the Description column, type Allows access to the Products screen, and then press Enter.

    Adding a permission

Closer Look

In this lesson you learned how to define a permission for your application. The permission can be assigned to a user or a group of users. At run time, the permission can be used to enable or disable screens when the application loads.

Permissions can be as granular as necessary. You can create a permission for each screen in the application, or you can apply a single permission to multiple screens. For example, you can create a Manager permission that allows managers to access several different screens.

Next Steps

In the next lesson you will learn how to apply the permission that you just created to restrict access to a screen.

Next lesson: Restricting Access to Screens

See Also

Tasks

LightSwitch Authentication and Authorization

Other Resources

Enabling Authorization and Creating Permissions

Managing Settings in LightSwitch