Home >Backend Development >PHP Tutorial >typecho如何获取当前登录用户权限

typecho如何获取当前登录用户权限

WBOY
WBOYOriginal
2016-06-06 20:18:592249browse

我想在首页判断当前登录用户的权限,如订阅者,管理员等,该如何判断呢?

回复内容:

我想在首页判断当前登录用户的权限,如订阅者,管理员等,该如何判断呢?

我想说你能多思考多看文档吗>?

在模板文件中获取用户所属权限组:

<code>echo "当前用户所属分组:".get_object_vars ($this->user)['row']['group'];</code>

有关权限控制的说明文档:
http://docs.typecho.org/develop/acl

typecho如何获取当前登录用户权限

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn