使用用户ID当前筛选记录登录的用户 [英] filter records using UserId of currently logged in user

查看:109
本文介绍了使用用户ID当前筛选记录登录的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序由用户在这里可以添加其他工作人员名单与他的用户ID。

我的角色由在哪里时,如果登录,他也可以看到被其他人员加入什么列表中的一个是员工的作用。

我需要做什么过滤每位员工将在下拉看到了什么,即每个人都应该只能查看他根据自己的ID添加的记录。

我怎么样来做到这一点是检查当前用户ID登录的用户,只让他查看他的纪录正在被填充在下拉组合框。

I have got an application where by a user can add other lists of Staff with his user ID.
I have roles where by if one is in role of staff, when logged in he can see also list of what was added by other staff.
What I need to do filter what each staff will see in a drop-down, i.e Each should only view the records he added according to his ID.
How I like to do it is check the user Id of currently logged in user, and only let him view his records which are being populated in a drop-down combo-box.

这个AP preciated建议

Suggestions about this appreciated

推荐答案

另外加入其他员工,你也需要存储谁创造了这个人员。

While adding other Staff, you need to store also that who created this staff.

现在,当下拉数据是牵强,也得到了下拉的CREATED_BY属性。再说了,你得到的下拉菜单的下拉和文本字段的值。在你的文本框,这将是你的员工的名字和你的价值领域这将是你dropdwon价值和CREATED_BY场被分离器分离出来(例如:〜:)或
现在,循环由第0个,其中产品可您的下拉值和第1项分裂它的值是CREATED_BY属性。

Now, when data for the dropdown is fetched, also get the CREATED_BY attribute of the dropdown. Say, you get the value of the dropdown and text field of the dropdown. In your textfield, it will be the your staff names and in your value field it will be your dropdwon value and CREATED_BY field separated by a splitter(e.g: ~ or :) Now, loop in the value by splitting it where 0th item is your dropdown value and 1th item is CREATED_BY attribute.

与登录用户ID和显示您所需要的比较吧。

Compare it with the logged in user id and display what you require.

这篇关于使用用户ID当前筛选记录登录的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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