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. Web Development
  3. ASP.NET
  4. Rolebase Security!

Rolebase Security!

Scheduled Pinned Locked Moved ASP.NET
asp-netcsharpdatabasesecurityhelp
6 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.
  • L Offline
    L Offline
    Learner520
    wrote on last edited by
    #1

    hi every1, i m beginner in asp.net I have watched tutorials on Role base security and trying to implement it.In aspnet database (same database uses for default web sercuty) i added a simple student table with two cols (UserId, UserName) then made a one to one relation between aspnet_User and Student. when i created a user through Asp.net configuration. I found that UserId has been added into both aspnet_users and aspnet_membership tables but not in Student table. please could u explain me how i can add same userid in student table as it has been added in users and membership table. if i cant save UserId in any other table at all then pleas tell me how i can add student data like(CourseId,startdate) wit same user Id. I ll really appriciate ur help. regards learner

    C A 2 Replies Last reply
    0
    • L Learner520

      hi every1, i m beginner in asp.net I have watched tutorials on Role base security and trying to implement it.In aspnet database (same database uses for default web sercuty) i added a simple student table with two cols (UserId, UserName) then made a one to one relation between aspnet_User and Student. when i created a user through Asp.net configuration. I found that UserId has been added into both aspnet_users and aspnet_membership tables but not in Student table. please could u explain me how i can add same userid in student table as it has been added in users and membership table. if i cant save UserId in any other table at all then pleas tell me how i can add student data like(CourseId,startdate) wit same user Id. I ll really appriciate ur help. regards learner

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This seems like a complex task for a beginner, are you teaching yourself ? You should start with something simpler.

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      1 Reply Last reply
      0
      • L Learner520

        hi every1, i m beginner in asp.net I have watched tutorials on Role base security and trying to implement it.In aspnet database (same database uses for default web sercuty) i added a simple student table with two cols (UserId, UserName) then made a one to one relation between aspnet_User and Student. when i created a user through Asp.net configuration. I found that UserId has been added into both aspnet_users and aspnet_membership tables but not in Student table. please could u explain me how i can add same userid in student table as it has been added in users and membership table. if i cant save UserId in any other table at all then pleas tell me how i can add student data like(CourseId,startdate) wit same user Id. I ll really appriciate ur help. regards learner

        A Offline
        A Offline
        AprNgp
        wrote on last edited by
        #3

        Learner520 wrote:

        how i can add same userid in student table as it has been added in users and membership table

        u have to add the UserId in 'your' table yourselves ...

        Learner520 wrote:

        how i can add student data like(CourseId,startdate) wit same user Id

        u can extract the UserId of any user using UserName. MembershipUser mu=Membership.GetUser("");

        Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

        L 1 Reply Last reply
        0
        • A AprNgp

          Learner520 wrote:

          how i can add same userid in student table as it has been added in users and membership table

          u have to add the UserId in 'your' table yourselves ...

          Learner520 wrote:

          how i can add student data like(CourseId,startdate) wit same user Id

          u can extract the UserId of any user using UserName. MembershipUser mu=Membership.GetUser("");

          Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

          L Offline
          L Offline
          Learner520
          wrote on last edited by
          #4

          thanks for your answer, but I'm sorry I have just realized that I should explain my question properly actually I have three roles in my database CourseTutor, Supervisor, and Student. I want to maintain Student data for this strong reason I need all UserIds' which belong to student and it should save into student table. (I want to work on StudentIds' rather than their names). Is this possible to get all those UserId's which related to Student's role, from Stored procedure. regards learner

          A 1 Reply Last reply
          0
          • L Learner520

            thanks for your answer, but I'm sorry I have just realized that I should explain my question properly actually I have three roles in my database CourseTutor, Supervisor, and Student. I want to maintain Student data for this strong reason I need all UserIds' which belong to student and it should save into student table. (I want to work on StudentIds' rather than their names). Is this possible to get all those UserId's which related to Student's role, from Stored procedure. regards learner

            A Offline
            A Offline
            AprNgp
            wrote on last edited by
            #5

            u need not store roles and userids separately ... while registering users, assign a role to them ... now to store personal info, create a table with columns about UserId,name,address etc .... in the CreatedUser event handler, add a row in this table ... to know the role of any user, u can use Roles.GetRolesForUser("<username>"); u can use, Roles.GetUsersInRole("<rolename>"); to get all the users in a particular role ...

            Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

            L 1 Reply Last reply
            0
            • A AprNgp

              u need not store roles and userids separately ... while registering users, assign a role to them ... now to store personal info, create a table with columns about UserId,name,address etc .... in the CreatedUser event handler, add a row in this table ... to know the role of any user, u can use Roles.GetRolesForUser("<username>"); u can use, Roles.GetUsersInRole("<rolename>"); to get all the users in a particular role ...

              Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

              L Offline
              L Offline
              Learner520
              wrote on last edited by
              #6

              I really appreciate that you gave me the exact answer what I'm looking for. thnx again. actually I was doing the same as you have mentioned like register a user form Asp.net configuration and assign them roles. but I wasn't sure how to store all UserId's which belongs to Student's role into Student table as well. regards learner

              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