@Component public class SysRoleModuleDirective extends AbstractTemplateDirective
参数列表
roleIds
:多个角色id
moduleId
模块id,roleIds、moduleId都存在时,结果返回true
或false
,表示这些角色是否拥有该模块的数据权限
moduleIds
多个模块id,当roleIds存在,且moduleId为空时生效,结果返回map
(模块id,true
或false
)
<@sys.roleModule roleIds='1,2,3' modelId='page'>${object}</@sys.roleModule>
<@sys.roleModule roleIds='1,2,3' modelIds='page,content'><#list map as k,v>${k}:${v}<#sep>,</#list></@sys.roleModule>
<script> $.getJSON('${site.dynamicPath}api/directive/sys/roleModule?roleIds=1,2,3&modelId=page&appToken=接口访问授权Token', function(data){ console.log(data); }); </script>
限定符和类型 | 字段和说明 |
---|---|
protected ConfigDataComponent |
configDataComponent |
private SysRoleModuleService |
service |
private SysRoleService |
sysRoleService |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
SysRoleModuleDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
boolean |
needAppToken() |
execute, expose, getAdvanced, getApp, getSite, getUserId, needUserToken, supportAdvanced
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private SysRoleService sysRoleService
protected ConfigDataComponent configDataComponent
private SysRoleModuleService service
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException
public boolean needAppToken()
needAppToken
在类中 AbstractTemplateDirective