| | |
| | | const { wsCache } = useCache() |
| | | const permissionDatas = value |
| | | const all_permission = '*:*:*' |
| | | const permissions = wsCache.get(CACHE_KEY.USER).permissions |
| | | const userInfo = wsCache.get(CACHE_KEY.USER) |
| | | const permissions = userInfo?.permissions || [] |
| | | const hasPermission = permissions.some((permission) => { |
| | | return all_permission === permission || permissionDatas.includes(permission) |
| | | }) |
| | |
| | | const { wsCache } = useCache() |
| | | const permissionRoles = value |
| | | const super_admin = 'admin' |
| | | const roles = wsCache.get(CACHE_KEY.USER).roles |
| | | const userInfo = wsCache.get(CACHE_KEY.USER) |
| | | const roles = userInfo?.roles || [] |
| | | const hasRole = roles.some((role) => { |
| | | return super_admin === role || permissionRoles.includes(role) |
| | | }) |