September 6, 2015 at 11:13 pm
I am designing an application where multiple users can be assign to a product for review. If a user doesn't have access to the product, they are not allowed to see it. I have attached my table design. I will appreciate if some one can let me know if it is correct. All users are assign to a role. See attached screen
September 6, 2015 at 11:32 pm
I am designing an application where multiple users can be assign to a product for review. If a user doesn't have access to the product, they are not allowed to see it.
You would probably have to create a view to do that... here's a quick article on getting the logged in user's username:
http://blog.sqlauthority.com/2009/05/26/sql-server-find-hostname-and-current-logged-in-user-name/
Then you could do something like this:
CREATE VIEW <viewname> AS
SELECT {fieldlist}
FROM MyTable
WHERE LoggedInUser = SUSER_NAME();
Either that or you'd create stored procedures to do the CRUD stuff for you. Gives you MUCH better control, and you don't have to grant the user access to the underlying table(s).
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy