天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 1952|回复: 0

[Iscript] 判断当前用户在当前程序中是否拥有某角色的权限示例【判断用户的角色权限】

[复制链接]
purple 发表于 2012-7-17 17:14:25 | 显示全部楼层 |阅读模式
本帖最后由 bess 于 2012-12-31 15:13 编辑

判断当前用户在当前程序中是否拥有某角色的权限:
var user = getWebUser();//获取当前登陆用户
var roles = user.getRoles();//获取当前登录用户的角色集合
var rtn=false;
var currentApplicationid =getApplication();
for(var it = roles.iterator();roles!=null && it.hasNext();)
{
var role = it.next();
if(currentApplicationid.equals(role.getApplicationid()))
{               
if(role.getName()=="行政助理" || role.getName()=="管理员")
{
    rtn=true;
}
}
}
rtn;

摘自fys的分享,原帖子链接:http://www.teemlink.com/bbs/view ... ypeid%3D2#pid199654

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 16:04

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表