Skip to content

Commit

Permalink
更新 shiro 手册
Browse files Browse the repository at this point in the history
  • Loading branch information
yong.teng committed Jan 6, 2024
1 parent f3bdbc9 commit 87d1ed9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/NAV.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [Buession Framework](https://www.buession.com/)
* [Buession Security](https://security.buession.com/)
* [Buession Logging](https://logging.buession.com/)
* [Buession Canal](https://canal.buession.com/)
* [Buession SpringBoot](https://springboot.buession.com/)
* [Buession SpringCloud](https://springcloud.buession.com/)
* [Buession Cas](https://cas.buession.com/)
Expand Down
3 changes: 2 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ banner:
btns:
- { name: '开 始', href: '/docs/quickstart.html', primary: true }
- { name: 'Github >', href: 'https://github.com/buession/buession-shirojs' }
caption: '当前版本: v1.2.1'
caption: '当前版本: v1.2.2'
features:
- { name: '优雅', desc: '旨在提供便捷的、统一的、可靠的权限前端权限验证工具,拥有完善的文档和高可读性的源码' }
- { name: '易用', desc: '参考 Apache Shiro 官方 JspTag API 设计,拥有和原生 JspTag 相同的 API,极大的减少学习成本' }
Expand All @@ -26,6 +26,7 @@ footer:
- { name: 'Buession Framework', href: 'https://www.buession.com/' }
- { name: 'Buession Security', href: 'https://security.buession.com/' }
- { name: 'Buession Logging', href: 'https://logging.buession.com/' }
- { name: 'Buession Canal', href: 'https://canal.buession.com/' }
- { name: 'Buession SpringBoot', href: 'https://springboot.buession.com/' }
- { name: 'Buession SpringCloud', href: 'https://springcloud.buession.com/' }
- { name: 'Buession Cas', href: 'https://cas.buession.com/' }
Expand Down
42 changes: 42 additions & 0 deletions src/manual/permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| [hasPermission](permission.html#权限-api-haspermissionpermissionname-string) | 验证用户是否具备某权限 |
| [lacksPermission](permission.html#权限-api-lackspermissionpermissionname-string) | 验证用户是否不具备某权限 |
| [hasAnyPermission](permission.html#权限-api-hasanypermissionpermissionnames-string[]) | 验证用户是否具有以下任意一个权限 |
| [hasAllPermissions](permission.html#权限-api-haspermissionsallpermissionnames-string[]) | 验证用户是否具有以下所有权限 |
| [hasPermissionsAll](permission.html#权限-api-haspermissionsallpermissionnames-string[]) | 验证用户是否具有以下所有权限 |


Expand Down Expand Up @@ -170,6 +171,47 @@ vue
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
setup() {
}
});
</script>
```


### **hasAllPermissions(permissionNames: string[])**
* 类型:`Function`

* 功能描述:验证用户是否具有以下所有权限

* 参数:permissionNames 权限列表

* 返回值:`boolean` 用户是否具有以下所有权限

示例:

原生 JavaScript
```javascript
<script type="text/javascript">
if(shiro.hasAllPermissions('user:add', 'user:edit') === true) {
return "用户具有 user:add 和 user:edit 权限";
}else{
return "用户不具有 user:add 或 user:edit 权限";
}
</script>
```

vue
```html
<template>
<div>
<div v-if="shiro.hasAllPermissions('user:add', 'user:edit') === true">用户具有 user:add 和 user:edit 权限</div>
<div v-if="shiro.hasAllPermissions('user:add', 'user:edit') === false">用户不具有 user:add 或 user:edit 权限</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
Expand Down

0 comments on commit 87d1ed9

Please sign in to comment.