Introduction
In this article I describe how to create permission and write code to set permission for a query using LightSwitch in Visual Studio 2012.
Here, we learn how to define a permission for our application. The permission can be assigned to a user or a group of users.
Permission in LightSwitch for Queries
1. Creating a permission in LightSwitch
Step 1
Open the Solution Explorer in LightSwitch Visual Studio 2012.
Image 1

Step 2
In the Solution Explorer double-click or right-click and select "Properties".
Image 2

Step 3
The Application Designer will appear.
Image 3

Step 4
Choose the "Access control" option in the application designer.
Image 4

Step 5
Select the type of authentication to use and in this use form authentication.
Image 5

Step 6
In the "Define permissions or select permissions to use for debugging" node click on "<Add New Permission>" then type "Can_View_Employee" under "Name".
Image 6

Step 7
Similarly, under the "Display Name" column type "View Employee".
Image 7

Step 8
And in the same manner under the Description column type "Provide access to the employee screen".
Image 8

Step 9
Under the "Grant For Debug" column mark the checkbox as checked then the table will appear or if we mark the checkbox as unchecked then the table will not appear on the screen.
Image 9









Comments
Join the conversation! Your thoughts help the community grow.