0

I’m currently working on a LightSwitch (LS) app that will be use for tracking project workload across multiple departments in my organization. I intend on using Windows Authentication (Allow only user and AD sec groups) for my access control. I’ve hit a brick wall in my thought/design process. When approaching this project my first thought was to set up a “Users” table that will be referenced in my other tables when a user performs any DB insert. Heres a basic diagram to help illustrate:.

enter image description here

This is where I’m stuck. When you publish a LS app, you can choose to also publish the SQL DB schema that you designed in LS which i intend on doing. When it publishes the schema, it also includes the popular asp.net membership tables/SP’s. This is where where LS stores the applications users. Because this table isn't created until after the application has been published i can’t reference it in my code. And the reason i would like to reference it, is so when a user does a insert into the WorkLog table, i can use the username/ID. I can also use the username to do Row Level Security (RLS). Anyone have any suggestions on how i can achieve this?

Nutshell: I would like to reference the table that the registered users are stored in so i can use their username/userID in my other tables. I’m open to ANY suggestion at this point

HiTech
  • 913
  • 1
  • 16
  • 34

1 Answers1

-1

I use a "Users" table to store many details that are not stored in the .net tables such as phone, picture, department,etc. and use the active directory account to compare the user, then use the "Users" properties in the app because the user has already been authenticated. That way, I can add any property to the Users table that I need and I don't need to change the .net tables. For auditing, You can use Beth Massi's blog or this forum link:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/21da645b-93ba-41c9-a224-ea6a74362d15/how-to-create-a-simple-audit-trail-change-log-in-lightswitch-in-c?forum=lightswitch

Scott

Scott
  • 1
  • How are you doing the comparison on the Users table? Are you iterating through DataWorkspace.SecurityData.UserRegistrations? Or do you have a direct relationship in your users table to the SecurityData? Could you please explain exactly what your doing please? – HiTech Aug 18 '14 at 07:24