管理员查看文件部门 [英] admin view documents thorugh department

查看:81
本文介绍了管理员查看文件部门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



管理员即john在注册后链接到hr部门,然后选择hr部门,他的数据存储在uerss表中,在此表中,id设置为dep id = 2 whihc is dep2

然后我想要当他登录他的登录ID和密码然后他只有hr文件而不是其他文件,如金融,计算机科学,营销和我尝试这个查询

first我选择dep id

hey
Admin i.e john is linked to hr department when he signup then choose hr department and his data is store in uerss table and in this table there id is set as dep id =2 whihc is dep2
then i want when he login through his login id and password then he only hr documents not other document like finance ,computer science,marketing and i try this query
first i select dep id

ALTER procedure [dbo].[sphrdoc]

@UserName  nvarchar(50),
@Password nvarchar(50)
as
select DepID from Userss where UserName=@UserName AND [Password]=@Password

推荐答案

这是像地狱一样凌乱。我无法跟踪你正在做的事情。在会话中存储id,即用户的id。在DB中存储用户可以看到的文档类型,基本上是一个权限系统。使所有过程获取该用户ID并根据这些权限进行过滤。
This is messy as hell. I can't follow what you're doing. Store an id in the session, the id of a user. Store in the DB what document types that user can see, basically a permission system. Make all the procs take that user id and filter based on those permissions.


这篇关于管理员查看文件部门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆