Acting as the Application Administrator

This lesson shows how to perform administrative tasks such as adding roles and users.

Acting as Administrator

To perform administrative tasks

  1. On the Windows Start menu, click Northwind Application.

    The Northwind Application displays a logon screen.

  2. On the logon screen, in the User Name box, type admin, in the Password box, type Admin_007, and then click Log In.

To assign a permission to an existing role

  1. Click the Roles menu under Administration to display the Roles screen.

    In the Roles pane, the Administrator role is displayed; in the Permissions pane, the Security Administration permission is displayed; and in the Users in this Role pane, the admin user name is displayed.

    Administrative screens

  2. In the Permissions pane, click Add, and then in the Permissions list, click View Products.

  3. On the application toolbar, click Save to save the change.

  4. Close the application and then use the Administrator user name and password to log on again.

    Verify that the permissions for the Administrator role now include viewing the Products screen.

To add a new role

  1. Click the Roles menu under Administration to display the Roles screen.

  2. In the Roles pane, click Add.

  3. In the Add New Role dialog box, type Manager, and then click OK.

  4. In the Permissions pane, click Add, and then in the Permissions list, click View Products.

  5. On the application toolbar, click Save to save the change.

    Now, two roles, Administrator and Manager, are listed in the Roles pane.

To add users

  1. Click the Users menu under Administration to display the Users screen.

    The Administrator user profile is displayed.

  2. In the Users pane, click Add.

  3. In the right pane, in the User Name: field, type tim.

  4. In the Full Name: field, type Tim Manager.

  5. In the Password: field, type Mgr_001.

  6. In the Confirm Password: field, type Mgr_001.

  7. In the Roles pane, click Add, and then in the Roles list, click Manager.

  8. On the application toolbar, click Save to save the changes.

    Now, two users, Administrator and Tim Manager, are listed in the Users pane.

  9. In the Users pane, click Add.

  10. In the right pane, in the User Name: field, type bob.

  11. In the Full Name: field, type Bob Employee.

  12. In the Password: field, type Employee_001.

  13. In the Confirm Password: field, type Employee_001.

  14. On the application toolbar, click Save to save the changes.

To test the changes

  1. Close the application and restart it.

  2. On the logon screen, in the User Name box, type tim, in the Password box, type Mgr_001, and then click Log In.

  3. Verify that you can display the Products screen and that the Administration screens are unavailable.

  4. Close the application and restart it.

  5. On the logon screen, in the User Name box, type bob, in the Password box, type Employee_001, and then click Log In.

  6. Verify that the Products screen and the Administration screens are unavailable.

Closer Look

This lesson showed how to log on as an administrator and then add roles and users. Once a role has been defined, you can assign it to multiple users so that they all have the same permissions.

When you added the user Bob, you may have noticed that you did not assign a role. A user who has not been assigned a role has no permissions and can only view screens for which permissions have not been assigned.

This example uses Forms authentication. If you use Windows authentication, you would type a user’s Windows logon identity in the User Name field in the form domain\username. When you use Windows authentication, you do not have to specify passwords.

Next Steps

In the next lesson you will learn about extensions.

Next lesson: Using Extensions to Enhance LightSwitch

See Also

Concepts

How to: Deploy a 2-tier Application

Other Resources

Distributing Your Application

Deployment: Distributing and Maintaining Your Application