locked
Multiple Department Lightswitch Application RRS feed

  • Question

  • I am writing an application that includes data for several departments.  I've put all the departments data in the same SQL Server 2008 R2 database for convenience.  Each department has various needs and can view all or parts of another department's data.  My problem is how to write a portal or front-end to accomplish this.  I can easily make home screens for each department but for maintainability it would be nice to accomplish with one home screen. I'm not too far beyond the novice developer stage and would appreciate any tips or ideas. Thanks.

    Vern Miller

    Tuesday, February 19, 2013 12:13 AM

Answers

  • Hello

    There is a lot of guess work here as you have not given much away. Is your only issue that you want to create one home screen for all but turn on and off parts of it?

    I am guessing that you have a windows network (seeing as you are thinking of using LS) and that you are on a windows network. With this in mind I would create my application using Windows Security and then set up groups within the application for each department. Then I would turn on and off areas of the application based on the security of the person who is trying to access it.

    I have no code samples that I can think of as I am at the breakfast table but if you need some then just ask and I am sure someone in the community will help.


    If you found this post helpful, please mark it as helpful. If by some chance I answered the question, please mark the question as answered. That way you will help more people like me :)

    • Marked as answer by VernMiller Monday, April 8, 2013 4:20 PM
    Tuesday, February 19, 2013 6:38 AM

All replies

  • Hello

    There is a lot of guess work here as you have not given much away. Is your only issue that you want to create one home screen for all but turn on and off parts of it?

    I am guessing that you have a windows network (seeing as you are thinking of using LS) and that you are on a windows network. With this in mind I would create my application using Windows Security and then set up groups within the application for each department. Then I would turn on and off areas of the application based on the security of the person who is trying to access it.

    I have no code samples that I can think of as I am at the breakfast table but if you need some then just ask and I am sure someone in the community will help.


    If you found this post helpful, please mark it as helpful. If by some chance I answered the question, please mark the question as answered. That way you will help more people like me :)

    • Marked as answer by VernMiller Monday, April 8, 2013 4:20 PM
    Tuesday, February 19, 2013 6:38 AM
  • Thanks for the reply and that sounds like exactly what I want.  Sorry about not enough description, I'm pretty much a newbie.

    Vern Miller

    Monday, April 8, 2013 4:20 PM
  • Hey Vern,

    You might also take a look at this good article. I understand you're trying to expose certain columns based on permissions, but sometimes it is also necessary to implement row level security so that each department can only see their own data. The article uses preprocess_query, but you can now use the new filter functionality. Hope that helps.

    Tuesday, April 9, 2013 6:42 AM
  • Thanks. That is a great article and at first glance it appears to be just what I need.

    Vern Miller

    Tuesday, April 9, 2013 2:46 PM
  • Vern,

         I have created apps with both scenarios (screens per department and the same screen with shown/hidden controls for each department).

    While the single screen may sound "easier", it has a couple of drawbacks (from my experience).  The two main ones are:

    Keeping track of controls and permissions: The more complicated the screen data, the more controls and therefore more things you have to "turn on/turn off" depending upon the user's department.  This can become more difficult to keep track of as  your screens get more complicated.  Also, depending upon the granularity of the roles, permissions can become pretty busy on one screen.

    Performance:  I have noticed a significant performance impact on a multi-departmental screen (vs. a screen per department).  Depending upon the queries, etc. you can slow a screen down 3-4 times as slow (which can translate into several seconds).  I am currently converting a single screen app to a multiscreen app because of this issue.

    Hope this helps!

    Scott

    Tuesday, April 9, 2013 5:03 PM
  • Thanks for your good input.

    Vern Miller

    Tuesday, April 9, 2013 5:22 PM