Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C Sharp Login with different user privilege

C Sharp Login with different user privilege

Scheduled Pinned Locked Moved C#
csharpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xonel
    wrote on last edited by
    #1

    Hello I have an application that is basically built on Tab control. I have 8 tabs and i need to have different domains(e.g Admin, clerk, bursar, secretary) on my login where when a user under a specific domain clicks on a certain tab, an event is generated that prevents him from viewing the content of that tab Any advice please???

    S B 2 Replies Last reply
    0
    • X Xonel

      Hello I have an application that is basically built on Tab control. I have 8 tabs and i need to have different domains(e.g Admin, clerk, bursar, secretary) on my login where when a user under a specific domain clicks on a certain tab, an event is generated that prevents him from viewing the content of that tab Any advice please???

      S Offline
      S Offline
      Sebastian T Xavier
      wrote on last edited by
      #2

      It will be better to define different roles & privileges; Then we can show / hide different tabs based on the privileges of the logined user.

      X 1 Reply Last reply
      0
      • S Sebastian T Xavier

        It will be better to define different roles & privileges; Then we can show / hide different tabs based on the privileges of the logined user.

        X Offline
        X Offline
        Xonel
        wrote on last edited by
        #3

        Please give me a simple guide line... Thank you

        1 Reply Last reply
        0
        • X Xonel

          Hello I have an application that is basically built on Tab control. I have 8 tabs and i need to have different domains(e.g Admin, clerk, bursar, secretary) on my login where when a user under a specific domain clicks on a certain tab, an event is generated that prevents him from viewing the content of that tab Any advice please???

          B Offline
          B Offline
          BobJanova
          wrote on last edited by
          #4

          Web app, or desktop? (It helps to be precise in your initial question.)

          X 1 Reply Last reply
          0
          • B BobJanova

            Web app, or desktop? (It helps to be precise in your initial question.)

            X Offline
            X Offline
            Xonel
            wrote on last edited by
            #5

            It is a desktop application

            B X 2 Replies Last reply
            0
            • X Xonel

              It is a desktop application

              B Offline
              B Offline
              BobJanova
              wrote on last edited by
              #6

              Okay, so you need to manage roles yourself, unless you want to use the standard Windows account properties. I think you can get the group name and you can definitely get the domain and user name.

              1 Reply Last reply
              0
              • X Xonel

                It is a desktop application

                X Offline
                X Offline
                Xonel
                wrote on last edited by
                #7

                I was thinking of it this way...

                    private void Form1\_Load(object sender, EventArgs e)
                    
                    {          
                	if ((Thread.CurrentPrincipal.IsInRole("admin"))) // admin in this case should be a domain name.
                	{
                	tabPage4.Hide();
                	}
                	else 
                	{
                		MessageBox.Show("You must be a member of the Manager or Administrator's roles to view username and password information", "Insufficient Permissions",
                			MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                	}
                }
                

                But now instead of

                CurrentPrincipal.IsInRole

                put something that will read the domain name. Something of that sort. I'll appreciate any help Thank you

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups