Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login Membership contols question

Status
Not open for further replies.

kss444

Programmer
Sep 19, 2006
306
US
I have a manageusers.aspx page with a code behind page.
When this page loads I call Membership.GetAllUsers and bind to a gridview (so then I can edit the user or delete them)

What I want to do is populate this gridview based on who is logged in.
This is my structure. My roles are Administrator, Power User, User.
I am the only Admin and I can do and see everyone, but I want my power users (who are companies) to be able to see just the company users.

So say I have company xyz and they have 5 users, I want the power user of company xyz to see their 5 users and not everyone.

Is this possible? If so how do I go about getting this done? This is my first time having to deal with the login controls and membership and roles so bare with me.

Eventually I want the power user to also add users just for their company.

Thanks All.


Ordinary Programmer
 
Personally I'd do this in the database.

Pass the id of the power user's company into the database, and select all users who match that company id.

Why pull back all users and then filter out the ones you need when you can just tell the db to give you the ones you need ?

caveat: I am assuming your membership is in some king of database storage.

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top