Theory guidance needed RRS feed

  • Question

  • Hi. I am fairly new to lightswitch and I am stuck on how to proceed with building my project. I am not looking for code, but rather theory.

    My project is linked to a sql database. I have 2 tables one is a list of User Types and the other table is a list of permissions a user type can have. There are about 20 permissions. An example of a User Type is AdminA and an example of a permission can be System Settings. The choices for any permission is None,View, or Full. I need the ability to set all the permissions for the existing User Types and  create new user types and permissions for that matter as well, although creating a new permission will be far in few. My tables are related in by a UserTypeID which is automatically generated in sql on the UserType table but passed into the Permission table in lightswitch.

    My UserType table is populated but Permission Table is not. Ideally I'd like to have a choice list for each permission (None, View, Full) .

    Here's where I get stuck. I start with a search data screen, make UserType a label with a link. I'd like to click the link and open a new screen with permissions. I cannot figure out a way to open a new screen that will show the user type at the top with all the permissions below in a column. I also can't figure out how to make a choice list that each permission can have without adding the choices to each permission at the entity level. I try to create a table of choices and a query from that an auto complete box can pull from but I just can't wrap my head around it.

    So again, not looking for code, just simple theory is all.

    Please let me know if I need to be more specific than that.

    Tuesday, December 16, 2014 1:42 PM


  • I think the best place for starting with theory is here

    In Part 1 link you can find a simple example for defining a choice list, look for 'Gender', you can do the same for you permission level (None, View, Full).

    About screens: you first need to create a Browse Data Screen and an Add/Edit Details screen for your User Types entity (table).

    If you have previously defined the relation between your tables through User Type Id field, then when creating the Add/Edit Details screen you will be able to include Permissions too (by checking under the 'Additional Data to include' section).

    After that you'll need to create at least an Add/Edit Details screen for editing Permissions.

    Feel free to come back and ask for more detailed clarification after reading through Part 1,2 and 3.



    • Marked as answer by Angie Xu Thursday, December 25, 2014 8:18 AM
    Tuesday, December 16, 2014 5:15 PM