用户角色和权限
wordpress.org.cn
目录
- 1 介绍
- 2 角色摘要
- 3 角色
- 4 功能
- 4.1 切换主题
- 4.2 edit_themes
- 4.3 edit_theme_options
- 4.4 install_themes
- 4.5 activate_plugins
- 4.6 edit_plugins
- 4.7 install_plugins
- 4.8 edit_users
- 4.9 edit_files
- 4.10 manage_options
- 4.11 moderate_comments
- 4.12 manage_categories
- 4.13 manage_links
- 4.14 upload_files
- 4.15 import
- 4.16 unfiltered_html
- 4.17 edit_posts
- 4.18 edit_others_posts
- 4.19 edit_published_posts
- 4.20 publish_posts
- 4.21 edit_pages
- 4.22 read
- 4.23 edit_others_pages
- 4.24 edit_published_pages
- 4.25 edit_published_pages
- 4.26 delete_pages
- 4.27 delete_others_pages
- 4.28 delete_published_pages
- 4.29 delete_posts
- 4.30 delete_others_posts
- 4.31 delete_published_posts
- 4.32 delete_private_posts
- 4.33 edit_private_posts
- 4.34 read_private_posts
- 4.35 delete_private_pages
- 4.36 edit_private_pages
- 4.37 read_private_pages
- 4.38 delete_users
- 4.39 create_users
- 4.40 unfiltered_upload
- 4.41 edit_dashboard
- 4.42 update_plugins
- 4.43 delete_plugins
- 4.44 update_core
- 4.45 list_users
- 4.46 remove_users
- 4.47 add_users
- 4.48 promote_users
- 4.49 delete_themes
- 4.50 export
- 4.51 edit_comment
- 4.52 manage_network
- 4.53 manage_sites
- 4.54 manage_network_users
- 4.55 manage_network_themes
- 4.56 manage_network_options
- 5 User Levels
- 6 Change Log
- 7 Resources
- 8 Description
- 9 Usage
- 10 Result
介绍
WordPress 使用角色的概念来让博客的所有者对用户进行权限控制。博客所有者可以控制用户写文章、创建页面、管理插件、管理主题,以及管理其他用户的权限。博客所有者可以通过该工具分配用户权限。
WordPress 有五个预定义的角色: 管理员, 编辑, 作者, 投稿者 和 订阅者。每一种角色被允许执行一系列被称作为功能的任务。 There are many Capabilities including publish_posts, moderate_comments, and edit_users. The default Capabilities are pre-assigned to each Role.
The Administrator Role is allowed to perform all possible Capabilities. Each of the other Roles has a decreasing number of allowed Capabilities. For instance, the Subscriber Role has just the read Capability. One particular Role should not be considered to be senior to another Role. Rather, consider that Roles define the user's responsibilities within the blog.
The WordPress Plugin API allows Roles and Capabilities to be added, removed and changed. Since Plugins might change Roles and Capabilities, just the default ones are addressed in this article.
角色摘要
- Super Admin - Someone with access to the blog network administration features controlling the entire network (See Create a Network).
- Administrator - Somebody who has access to all the administration features
- Editor - Somebody who can publish and manage posts and pages as well as manage other users' posts, etc.
- Author - Somebody who can publish and manage their own posts
- Contributor - Somebody who can write and manage their posts but not publish them
- Subscriber - Somebody who can only manage their profile
Upon installing WordPress, an Administrator account with all Capabilities is automatically created.
The default role for new users can be set from the Settings General SubPanel.
角色
A Role defines the set of tasks a user is allowed to perform. For instance, the role of Administrator encompasses every possible task that can be performed within a WordPress blog. On the other hand, the Author role allows the execution of just a small subset of tasks.
The following sections list the default Roles and their Capabilities:
3.0版的新特色
The documentation needs to be updated to incorporate Multisite, and super admin.
All these capabilities are exclusive to the administrator role.
3.1版的新特色
超级管理员
- manage_network
- manage_sites
- manage_network_users
- manage_network_themes
- manage_network_options
- unfiltered_html when using Multisite
管理员
- activate_plugins
- add_users
- create_users
- delete_others_pages
- delete_others_posts
- delete_pages
- delete_plugins
- delete_posts
- delete_private_pages
- delete_private_posts
- delete_published_pages
- delete_published_posts
- delete_themes
- delete_users
- edit_dashboard
- edit_files
- edit_others_pages
- edit_others_posts
- edit_pages
- edit_plugins
- edit_posts
- edit_private_pages
- edit_private_posts
- edit_published_pages
- edit_published_posts
- edit_theme_options
- edit_themes
- edit_users
- export
- import
- install_plugins
- install_themes
- list_users
- manage_categories
- manage_links
- manage_options
- moderate_comments
- promote_users
- publish_pages
- publish_posts
- read_private_pages
- read_private_posts
- read
- remove_users
- switch_themes
- unfiltered_html (not with Multisite. See Unfiltered MU)
- unfiltered_upload
- update_core
- update_plugins
- update_themes
- upload_files
编辑
- delete_others_pages
- delete_others_posts
- delete_pages
- delete_posts
- delete_private_pages
- delete_private_posts
- delete_published_pages
- delete_published_posts
- edit_others_pages
- edit_others_posts
- edit_pages
- edit_posts
- edit_private_pages
- edit_private_posts
- edit_published_pages
- edit_published_posts
- manage_categories
- manage_links
- moderate_comments
- publish_pages
- publish_posts
- read
- read_private_pages
- read_private_posts
- unfiltered_html (not with Multisite. See Unfiltered MU)
- upload_files
作者
投稿人
订阅者
权限—用户角色对应关系
权限 | 超级管理员 | 管理员 | 编辑 | 作者 | 投稿者 | 订阅者 |
---|---|---|---|---|---|---|
管理_网络 | ||||||
管理_站点 | ||||||
管理_网络_用户 | ||||||
管理_网络_主题 | ||||||
管理_网络_选项 | ||||||
激活_插件 | ||||||
添加_用户 | ||||||
创建_用户 | ||||||
删除_插件 | ||||||
删除_主题 | ||||||
删除_用户 | ||||||
编辑_文件 | ||||||
编辑_插件 | ||||||
编辑_主题_选项 | ||||||
编辑_主题 | ||||||
编辑_用户 | ||||||
导出 | ||||||
导入 | ||||||
安装_插件 | ||||||
安装_主题 | ||||||
显示_用户 | ||||||
管理_选项 | ||||||
提升_用户 | ||||||
移除_用户 | ||||||
切换_主题 | ||||||
未滤过的_上传 | ||||||
更新_核心 | ||||||
更新_插件 | ||||||
更新_主题 | ||||||
编辑_控制板 | ||||||
节制_评论 | ||||||
管理_类别 | ||||||
管理_链接 | ||||||
未滤过的_html | ||||||
编辑_他人的_posts | ||||||
编辑_页面 | ||||||
编辑_他人的_页面 | ||||||
编辑_已发布_页面 | ||||||
发布_页面 | ||||||
删除_页面 | ||||||
删除_他人的_页面 | ||||||
删除_已发布_页面 | ||||||
删除_他人的_posts | ||||||
删除_私有的_posts | ||||||
编辑_私有的_posts | ||||||
阅读_私有的_posts | ||||||
删除_私有的_页面 | ||||||
编辑_私有的_页面 | ||||||
阅读_私有的_页面 | ||||||
编辑_已发布的_posts | ||||||
上传_文件 | ||||||
发布_posts | ||||||
删除_已发布_posts | ||||||
编辑_posts | ||||||
删除_posts | ||||||
阅读 |
功能
切换主题
- Since 2.0
- Allows access to Administration Panel options:
- Appearance
- Appearance > Themes
edit_themes
- Since 2.0
- Allows access to Appearance > Theme Editor to edit theme files.
edit_theme_options
- Since 3.0
- Allows access to Administration Panel options:
- Appearance > Background
- Appearance > Header
- Appearance > Menus
- Appearance > Widgets
- Also allows access to Theme Options pages if they are included in the Theme
install_themes
- Since 2.0
- Allows access to Administration Panel options:
- Appearance > Add New Themes
activate_plugins
- Since 2.0
- Allows access to Administration Panel options:
edit_plugins
- Since 2.0
- Allows access to Administration Panel options:
install_plugins
- Since 2.0
- Allows access to Administration Panel options:
- Plugins > Add New
edit_users
- Since 2.0
- Allows access to Administration Panel options:
edit_files
- Since 2.0
- Note: No longer used.
manage_options
- Since 2.0
- Allows access to Administration Panel options:
- Settings > General
- Settings > Writing
- Settings > Reading
- Settings > Discussion
- Settings > Permalinks
- Settings > Miscellaneous
moderate_comments
- Since 2.0
- Allows users to moderate comments from the Comments SubPanel (although a user needs the edit_posts Capability in order to access this)
manage_categories
- Since 2.0
- Allows access to Administration Panel options:
- Posts > Categories
- Links > Categories
manage_links
- Since 2.0
- Allows access to Administration Panel options:
- Links
- Links > Add New
upload_files
- Since 2.0
- Allows access to Administration Panel options:
- Media
- Media > Add New
import
- Since 2.0
- Allows access to Administration Panel options:
- Tools > Import
- Tools > Export
unfiltered_html
- Since 2.0
- Allows user to post HTML markup or even JavaScript code in pages, posts, and comments.
- Note: Enabling this option for untrusted users may result in their posting malicious or poorly formatted code.
edit_posts
- Since 2.0
- Allows access to Administration Panel options:
- Posts
- Posts > Add New
- Comments
- Comments > Awaiting Moderation
edit_others_posts
- Since 2.0
- Allows access to Administration Panel options:
- Manage > Comments (Lets user delete and edit every comment, see edit_posts above)
- user can edit other users' posts through function get_others_drafts()
- user can see other users' images in inline-uploading [no? see inline-uploading.php]
- See Exceptions
edit_published_posts
- Since 2.0
- User can edit their published posts. This capability is off by default.
- The core checks the capability edit_posts, but on demand this check is changed to edit_published_posts.
- If you don't want a user to be able edit his published posts, remove this capability. (see also this comment on the Role Manager Plugin Homepage).
publish_posts
- Since 2.0
- See and use the "publish" button when editing their post (otherwise they can only save drafts)
- Can use XML-RPC to publish (otherwise they get a "Sorry, you can not post on this weblog or category.")
edit_pages
- Since 2.0
- Allows access to Administration Panel options:
- Pages
- Pages > Add New
read
- Since 2.0
- Allows access to Administration Panel options:
- Dashboard
- Users > Your Profile
- Used nowhere in the core code except the menu.php
edit_others_pages
- Since 2.1
edit_published_pages
- Since 2.1
edit_published_pages
- Since 2.1
delete_pages
- Since 2.1
delete_others_pages
- Since 2.1
delete_published_pages
- Since 2.1
delete_posts
- Since 2.1
delete_others_posts
- Since 2.1
delete_published_posts
- Since 2.1
delete_private_posts
- Since 2.1
edit_private_posts
- Since 2.1
read_private_posts
- Since 2.1
delete_private_pages
- Since 2.1
edit_private_pages
- Since 2.1
read_private_pages
- Since 2.1
delete_users
- Since 2.1
create_users
- Since 2.1
unfiltered_upload
- Since 2.3
edit_dashboard
- Since 2.5
update_plugins
- Since 2.6
delete_plugins
- Since 2.6
update_core
- Since 3.0
list_users
- Since 3.0
remove_users
- Since 3.0
add_users
- Since 3.0
promote_users
- Since 3.0
delete_themes
- Since 3.0
export
- Since 3.0
edit_comment
- Since 3.1
manage_network
- Since 3.0
- Multi-site only
- Allows access to Super Admin menu
- Allows user to upgrade network
manage_sites
- Since 3.0
- Multi-site only
- Allows access to Network Sites menu
- Allows user to add, edit, delete, archive, unarchive, activate, deactivate, spam and unspam new site/blog in the network
manage_network_users
- Since 3.0
- Multi-site only
- Allows access to Network Users menu
manage_network_themes
- Since 3.0
- Multi-site only
- Allows access to Network Themes menu
manage_network_options
- Since 3.0
- Multi-site only
- Allows access to Network Options menu
User Levels
Prior to version 2.0, WordPress used a user User Levels system. This was replaced in version 2.0 with the much improved and more extensible Roles and Capabilities system you see today. To maintain backwards compatibility with plugins that still use the user levels system (although this is very much discouraged), the default Roles in WordPress also include Capabilities that correspond to these levels. User Levels were finally deprecated in version 3.0.
Capability | Administrator | Editor | Author | Contributor | Subscriber |
---|---|---|---|---|---|
level_10 | |||||
level_9 | |||||
level_8 | |||||
level_7 | |||||
level_6 | |||||
level_5 | |||||
level_4 | |||||
level_3 | |||||
level_2 | |||||
level_1 | |||||
level_0 |
User Level to Role Conversion
- User Level 0 converts to Subscriber
- User Level 1 converts to Contributor
- User Level 2 converts to Author
- User Level 3 converts to Author
- User Level 4 converts to Author
- User Level 5 converts to Editor
- User Level 6 converts to Editor
- User Level 7 converts to Editor
- User Level 8 converts to Administrator
- User Level 9 converts to Administrator
- User Level 10 converts to Administrator
Change Log
- 1.5: User Levels system was introduced.
- 2.0: Roles and Capabilities system was introduced.
- 3.0: User Levels system deprecated.
Resources
- Plugins:
- Members Plugin
- Role Scoper Plugin
- Capability Manager Plugin (currently supports only up to 2.9)
- User Access Manager
- Information:
- Dev:
includeonlydiv style=clear:both; background-color:#FAEBD7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;This page is marked as incomplete. You can help Codex by expanding it./div/includeonlynoinclude
Description
This Template is used by Codex:Template Messages.
Usage
pre 检查到模板循环:模板:Message /pre
Result
检查到模板循环:模板:Message
/noinclude