Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring security 春季安全如何处理没有权限的问题_Spring Security - Fatal编程技术网

Spring security 春季安全如何处理没有权限的问题

Spring security 春季安全如何处理没有权限的问题,spring-security,Spring Security,使用Spring安全性,我们使用hasAuthority有条件地执行代码或有条件地在jsp中显示部分页面 例如: 或(在jsp中) .... 要显示/评估的内容 我想知道当你在没有权限的情况下想要展示/执行某些东西时如何处理 可能是 没有权限(“标记保存”) 我很确定,这不是一个突然出现的用例。 有人以任何方式处理过这个问题吗?事实上发现这可以使用EL。 所以使用一个!招牌有效 所以我让它像这样工作: <sec:authorize access="!hasAuthority('TAG_

使用Spring安全性,我们使用hasAuthority有条件地执行代码或有条件地在jsp中显示部分页面

例如:

或(在jsp中)


.... 要显示/评估的内容
我想知道当你在没有权限的情况下想要展示/执行某些东西时如何处理

可能是

没有权限(“标记保存”)

我很确定,这不是一个突然出现的用例。
有人以任何方式处理过这个问题吗?

事实上发现这可以使用EL。 所以使用一个!招牌有效

所以我让它像这样工作:

<sec:authorize access="!hasAuthority('TAG_SAVE')">
 .... content to display / evaluate when the Authority is not present
</sec:authorize>

.... 权限不存在时显示/评估的内容

您是否尝试过
!是否拥有权限
?谢谢Collin D,我用它工作了!权势
<sec:authorize access="hasAuthority('TAG_SAVE')">
 .... content to display / evaluate
</sec:authorize>
<sec:authorize access="!hasAuthority('TAG_SAVE')">
 .... content to display / evaluate when the Authority is not present
</sec:authorize>