允许并根据条件显示数据 [英] Permission and showing the data on the based of the condition

查看:75
本文介绍了允许并根据条件显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张表用于item,admin和userpermission.当我在表中输入一个项目时,则将itemid和adminid(包含哪个admin输入了该项目)插入到userpermission中.现在,我希望当我通过绑定显示这些项目时,可以显示输入这些项目的管理员,还可以显示通过超级管理员获得许可的项目,而其他项目则被隐藏.所以,我必须使用什么来获得超级管理员的许可. SuperAdmin是具有lid = 1的管理员,其盖子存储在会话中.

I have a table for item , admin and for userpermission . When i enter a item in table then the itemid and adminid(contains which admin entered that item) inserted into userpermission . Now i want that when i show these items through binding then the admin who entered these items can be shown and also the items which got permission through the superadmin will be shown and others are hidden. So what i have to use to get that permission from the superadmin . SuperAdmin is the admin which is having lid=1 and its lid is stored in session .

推荐答案



我想在您的问题中说一句话.您的桌子上有itemid,premisionid(adminid)对吗?

因此,当超级管理员授予项目管理员的权限时,他将如何操作.

是他为此维护另一个表还是为此使用同一表.

如果他使用相同的表格表示

使用此查询
Hi,

I want one clear thing in your question .you''ve table with itemid,premisionid(adminid) right?

so while superadmin give permission to admin for item then how he do that.

is he maintain another table for that or he uses same table for that.

If he uses same table means

use this query
select * from ItemPerTab where permisionid in (currentadminid)



最好的



All the Best


这篇关于允许并根据条件显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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