ASP.NET 成员资格层次结构?
嗨,我只是想知道如何实现某种会员层次结构。
例如:
校长
- 教师 1
-- student
-- student
- 教师 2
-- student
-- student
我希望设置一个教师可以创建学生的场景。每个老师只能看到他们的学生。校长可以看到所有教师及其学生。
我一直无法弄清楚如何使用 ASP.NET 的成员资格/角色来解决这个问题?
任何想法将不胜感激。
干杯。
Hi i was just wondering how to implement a membership hierachy of sorts..
For example:
Headmaster
-- Teacher1
-- student
-- student
-- Teacher2
-- student
-- student
I was hoping to setup a scenario where a teacher can create students. Each teacher can ONLY see their students. The headmaster can see all teachers and their students.
I haven't been able to work out how I'd approach this using asp.net's memberships/roles?
any ideas would be most appreciated.
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用角色来指示哪些用户是教师,哪些用户是校长,以便教师有权添加学生,但我不会将角色提供者用于教师/学生关系。相反,在数据库中创建连接学生和教师的关系,并在网页中设置用于查看学生的代码,这样,如果当前用户是教师,则只能访问与当前用户关联的学生。
You can use roles to indicate which users are teachers and which are headmasters, so that teachers have rights to add students, but I wouldn't use the role provider for the teacher/student relationship. Instead, create a relationship in the database that connects students to teachers, and set up code in your the web page for viewing students so that if the current user is a teacher, only students tied to the current user are accessible.