检查当前客户是否是Shopify中的管理员? [英] Check if current customer is an admin in Shopify?

查看:129
本文介绍了检查当前客户是否是Shopify中的管理员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Shopify主题的某些页面上添加一个条件,如果查看该页面的用户是管理员(并已登录),则该条件会显示更多信息.有没有办法做到这一点?一种明显的方法是对照一些属于管理员的硬编码值来检查customer.email属性.但这是维护的麻烦,而且设计不佳.有更好的方法吗?

I would like to add a conditional on some pages in my Shopify theme that displays more info if the user viewing the page is an admin (and is logged in). Is there a way to do this? The obvious way is to check the customer.email property against some hard-coded values that belong to admins. But that's a maintenance headache and a poor design. Is there a better way?

谢谢.

推荐答案

没有可用于检查的Shop帐户列表.您可以针对的唯一支票是商店的电子邮件地址或商店的customer_email,这有点像失败者.

There is no list of Shop accounts available to check against. The only check you could make against is the shop email address or the shop customer_email and that is kinda loser-ish.

由于Shopify尚未提供任何Shop帐户,因此您对此一无所知.甚至用于POS和WWW的嵌入式SDK都只提供了该用户是管理员,或该用户是职员帐户"的信息,但没有识别数据.

You're in tough on this one as Shopify does not yet provide any Shop accounts. Even the embedded SDK's for POS and WWW provide nothing more than "this user is an admin, or this user is a staff account", but no identifying data.

这篇关于检查当前客户是否是Shopify中的管理员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆