在delphi里,如何用0和1的字符串为系统分配权限,请给出代码
解决方案 »
- 串口通信
- 如何去掉快捷方式的热键?急!!!解决后立即结贴~~
- 如何设置word字体??
- 如何把一个字符串 copy到 clipboard上~~~在线急等?
- 那位高人真正会DELPHI的QUERY调用ORACLE的存储过程?(代过程)
- 100分求助,图形定位问题,使用控件:Image,请给出详细说明。
- 请问怎样能够在程序最小化时缩小到托盘上???
- 100分求助一个关于用ShockwaveFlash控件播放flash的问题!急,急,急,!!!
- 急需InfoPower控件
- 多表查询AdoQuery能否提交?
- Interface高手进来讨论
- 请问这是什么意思 Invalid object name 't_print'
//权限审核函数
//uid用户id,tname表名,done操作
//power1为权限字段char型10位,大部分只有1和0,1为有该权限,0无;
//
var
s:string;
begin
with frm_yongkaidenglu.ADOQuery1 do
begin
close;sql.Clear;
if (tname='采购系统') or (tname='销售系统') or (tname='仓库系统') then
begin
sql.Add('select power1 from power where userid='+''''+uid+'''');
end
else
begin
sql.Add('select power1 from power where userid='+''''+uid+''''+' and tablename='+''''+tname+'''');
end;
active:=true;
s:=fieldbyname('power1').AsString;
end;
if (done='采购子系统') and (strtoint(s[1])=1) then begin result:=true; end
else if (done='销售子系统') and (strtoint(s[2])=1) then begin result:=true; end
else if (done='仓库子系统') and (strtoint(s[3])=1) then begin result:=true; end
else if (done='采购审批') and (strtoint(s[4])>0) then begin result:=true; end
else if (done='销售审批') and (strtoint(s[5])>0) then begin result:=true; end
else if (done='系统') and (strtoint(s[6])=1) then
begin
if (tname='采购系统') and (strtoint(s[1])=1) then result:=true
else if (tname='销售系统') and (strtoint(s[2])=1) then result:=true
else if (tname='仓库系统') and (strtoint(s[3])=1) then result:=true
else result:=false;
end
else if (done='删除') and (strtoint(s[7])=1) then begin result:=true; end
else if (done='修改') and (strtoint(s[8])=1) then begin result:=true; end
else if (done='添加') and (strtoint(s[9])=1) then begin result:=true; end
else if (done='查询') and (strtoint(s[10])=1) then begin result:=true; end
else result:=false;
end;
可以用数据库存储功能组的可见菜单。
每个人是属于某几个功能组。
系统登录时调出其可见菜单,并由此生成用户主界面。
一套系统,在用户看来成为如干个。功能可以自由搭配