liteldev / permissionapi Goto Github PK
View Code? Open in Web Editor NEWLiteLoaderBDS permission APIs
License: GNU Lesser General Public License v3.0
LiteLoaderBDS permission APIs
License: GNU Lesser General Public License v3.0
Since write operations may be frequent
在llse的qiuckjs环境中进行的测试
LiteLoader版本 2.9.2
PermissionAPI版本 v2.9.0
LL权限组无法正确加载数据文件中的权限信息。
编写并运行如下QJS插件 运行的输出见代码内的注释
log(Permission.permissionExists("test:test"));
// 第一次启动本插件 这里输出 0 符合期待
try {
Permission.registerPermission("test:test", "test");
} catch (error) {
log(error);
// 第一次启动本插件 未发现本输出 符合期待
}
log(Permission.permissionExists("test:test"));
// 第一次启动本插件 这里输出 1 符合期待
输入perm list perm
得到以下输出
23:03:01 INFO [Server] 权限列表:
23:03:01 INFO [Server] * PermissionAPI:cmd_control: Access to /perm commands
23:03:01 INFO [Server] * test:test: test
输入stop
关闭服务器。
查看\plugins\PermissionAPI\data.json
此时内容如下
{
"permissions": {
"PermissionAPI:cmd_control": {
"desc": "Access to /perm commands"
},
"test:test": {
"desc": "test"
}
},
"roles": {
"admin": {
"displayName": "§cadmin",
"members": [],
"permissions": {},
"priority": 2147483647
},
"everyone": {
"displayName": "§7everyone",
"permissions": {},
"priority": 0
}
}
}
如果需要此时的相关文件的原始文件,下载这个
plugins-firstTimeRun.zip
再次启动服务器,并观察插件输出,结果如下(依旧采用代码内注释的形式标注)
log(Permission.permissionExists("test:test"));
// 第二次启动本插件 这里输出 1 不符合期待
try {
Permission.registerPermission("test:test", "test");
} catch (error) {
log(error);
// 第二次启动本插件 未发现本输出 不符合期待
}
log(Permission.permissionExists("test:test"));
// 第二次启动本插件 这里输出 1 符合期待
查看\plugins\PermissionAPI\data.json
发现内容与之前相同
移除测试插件
启动服务器
启动后,输入perm list perm
得到如下输出
23:08:19 INFO [Server] 权限列表:
23:08:19 INFO [Server] * PermissionAPI:cmd_control: Access to /perm commands
此时文件\plugins\PermissionAPI\data.json
内容为
{
"permissions": {
"PermissionAPI:cmd_control": {
"desc": "Access to /perm commands"
}
},
"roles": {
"admin": {
"displayName": "§cadmin",
"members": [],
"permissions": {},
"priority": 2147483647
},
"everyone": {
"displayName": "§7everyone",
"permissions": {},
"priority": 0
}
}
}
LL权限组无法正确加载数据文件中的权限信息。
补充信息:第四步是我写到这里时才想起来补充的,所得结果使得上序步骤意义不明,但是我懒得删了,所以就留着吧,希望没有给阅读带来挑战
Like title
PermGroup
-> Role
PermGroups
-> Roles
PermAbilityInfo
-> PermInfo
PermAbility
-> PermInstance
Like title
perm add/rm member <Role> <Name>
perm add/rm/set perm <Role> <Permission> [<Enabled>] [Extra]
perm set priority <Role> <Priority>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.