GBP: 基于组的权限管理
“因为 Bukkit 真正需要的不过是另一个权限插件罢了”
一款面向 Bukkit 的权限插件,其核心功能在于定义组成员身份。
基本理念是:要将用户 foo 添加到组 bar,无需前往 users.yml 文件并添加以下内容:
foo:
- groups:
- bar
……你只需直接打开 bar.txt 文件,并在末尾添加 “foo” 即可,就像操作 ops.txt 或 white-list.txt 等文件一样。
frymaster
foo
notch
这样做有何好处?因为它更容易与外部脚本集成。外部脚本只需输出一个名称列表,而无需生成复杂的 YAML 结构。例如,如果你希望根据论坛权限自动分配组身份,这一点尤为重要。
功能特性
- 扁平化的组成员身份列表,行为类似于内置的 ops.txt 文件
- 可为组分配权限和否定权限
- 一个组可以继承其他组的权限(这些被继承的组也可以拥有自己的父组等)——这些继承的权限会被显式设置的权限所覆盖
- 名为 all 和 ops 的元组(meta-groups),分别代表所有玩家和管理员,名字颇具趣味性
- 可定义“默认”组:仅当玩家没有任何显式的组成员身份时,才会被加入该组
- 支持组优先级:当某玩家属于多个组时,用于确定哪些权限具有优先权
- 仍保留传统的 users.yml 文件,允许在其中覆盖组成员身份(包括添加和否定)以及权限节点
本插件不支持的功能
本插件处于早期开发阶段。它尚未支持若干标准功能——实现这些功能后,项目将升级为“正式发布”状态:
- 游戏内命令:修改配置的唯一方式是直接编辑文件。组成员身份的测试文件会在每次玩家加入时重新读取,但若你对 .yml 文件进行了更改,仍需执行 /gbp reload 命令
- Vault API 集成
- 限时权限
未来功能规划
本插件的最终目标是能够从任意 MySQL 数据库中读取数据,并希望支持写入。这意味着它可以,例如,直接查询你的论坛以确定组成员身份。此外,你还可以选择写入成员身份;在更远的未来,或许还能将大部分配置项存储在数据库中,以支持分布式部署。
配置说明
groups.yml 和 users.yml 文件的内容应当相当直观易懂。如果仍有困惑,请告诉我具体哪里令人费解,我会补充更多文档。
统计信息收集
为了评估本插件的受欢迎程度和使用情况,自 1.0.2 版本起,安装数据会通过 Metrics 插件追踪系统自动记录。如果你不希望参与此项追踪,请在 plugins/PluginMetrics/config.yml 中将 opt-out 设置为 true 以禁用该功能。
目前仅发送默认统计信息,包括:
- 玩家数量
- 操作系统类型
- Java 版本
- 服务器版本
- 插件版本
Github
项目的 Github 仓库位于 ,问题追踪器也设在此处(尽管来自本项目的链接应直接指向问题追踪器)。虽然我会尽量回复本页面的评论,但如果你发现任何 Bug,使用问题追踪器将是更为可靠的解决方案。
开发构建版
本项目的开发构建版可通过提供的持续集成服务器获取。这些构建版未经 BukkitDev 工作人员审核。使用风险自负。
IRC
我常驻于 Espernet 网络上的 #bukkit 频道以及我的个人频道 #frymaster。我身处英国,除非在英国时间晚间,否则可能无法立即回复查询,但我已记录所有消息,并且最终一定会回复你。
GBP: Group Based Permissions
"Because what Bukkit really needs is another permissions plugin"
Permissions plugin for bukkit focussed around defining group membership as the core activity.
The basic idea is that to add a user foo to group bar, instead of going to users.yml and adding
foo:
- groups:
- bar
...you'd simply go to the bar.txt file and add "foo" to the end of it, just like you'd do with ops.txt or white-list.txt etc.
frymaster
foo
notch
Why might this be useful? Because it's a lot easier to integrate with external scripts if they have to simply output a list of names rather than generate a YAML structure. This important if you want to automatically assign group memberships based on your forum permissions, for example.
Features
- Flatfile group membership lists that work like the built-in ops.txt file
- Assign permissions and negative permissions to groups
- A group can inherit permissions from other groups (which can have their own parent etc.) - these will be overridden by the explicitly set permissions
- Meta-groups called all and ops which represent everyone and ops, funnily enough
- Can define "default" groups which people will be added to if and only if they have no explicit group memberships
- Group priorities to determine what permissions take priority if someone is a member of many groups
- Still features a conventional users.yml file where you can override group memberships (both add and negate) and permission nodes
What the plugin doesn't do
This plugin is in early stages of development. There are several standard features it doesn't yet support - implementing these will result in the project moving to "release" status
- In game commands - the only way to alter the configuration is to edit the files directly. The group membership testfiles are read every time a player joins, but you will have to do /gbp reload if you make changes to the .yml files
- Vault API integration
- Time-limited permissions
Future Features
Ultimately the aim of this plugin is to read, and hopefully write, from arbitrary mySQL databases. This would mean it could, for example, query your forum directly to determine group membership. Optionally you would be able to write memberships as well, and in the far future perhaps store most config items in a database as well, for distributed setups.
Configuration
The groups.yml and users.yml files should be fairly self-explanatory. If not, you should let me know what's confusing and I'll add more documentation
Stats collection
To determine popularity and usage of the plugin, installs are automatically tracked by the Metrics plugin tracking system in 1.0.2 and higher. If you don't want this tracking, set opt-out to true in plugins/PluginMetrics/config.yml to disable it.
Currently only the default stats are sent, which include:
- Player count
- OS Type
- Java version
- Server version
- Plugin version
Github
The github repository is at and the issue tracker is also there (though the links from this project should go direct to the issue tracker). While I'll try to answer comments on this page, if you find any bugs the tracker is a much more reliable solution
Development Builds
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
IRC
I idle in #bukkit and in my personal channel #frymaster on Espernet. I am in the UK and are unlikely to respond immediately to queries except in the evening, UK time, but I log all messages and I will get back to you eventually.
评论 0
登录后参与评分
还没有评论,来抢沙发吧