groups:
Admin:
info:
rank: 3
permissions:
- 'permissions.node'
- 'permissions.node'
Moderator:
info:
rank: 2
permissions:
- 'permissions.kick'
- 'permissions.modchat'
- 'permissions.modchat.disable'
User:
info:
rank: 1
permissions:
- 'permissions.help'
users:
Toni:
group(s): <-- Maybe a multi-group feature?
- 'Admin'
permissions: <-- You could use this to exempt players from certain permission nodes, so if you don't trust a certain co-owner or admin, you could just certainly deny the permission node there.
- 'froob.denied.from.using.abuse'
Hiddos:
group(s):
- 'Moderator'
- 'User'
permissions:
- 'deny.*' - certainly you wouldn't trust Hiddos with admin. he could be a silly abuser! joking :D
^ - This is where coders / users could use a asterisk to define ALL permissions node under that parameter, example: permissions.vehicles.* would allow players to do anything relating to permissions.vehicles.
CMD:ban(playerid, params[])
{
PermissionsCreate("admin.ban");
//Ban Code
}
native PermissionsCreate(permission-name[]) - Example: PermissionsCreate("admin.ban.ip");
native PermissionsCreateAsterisk(permission-node[]) - Example: PermissionsCreateAsterisk("admin.ban.*");
native PermissionsReload(); - Could be called under any callback to reload any changes to the configuration, or permissions files.
native PermissionsShowGroups(bool:order-by-name, (optional: with / without rank)); - Called under any command to list all of the groups. True or false, list the group names alphabetically. See below @ PermissionsCreateGroup for information on rank.
native PermissionsShowUsers(bool:order-by-name); - Called under any command to list all of the users inside the users.yml file, this list will probably your VIP groups, extra groups, or Staff.
native PermissionsCreateUser(name[], group id); - Example: A command with /permissions add <user/id> <group id> You could then retrieve a name with GetPlayerName, and get the group id manually.
native PermissionsCreateGroup(group name[], (optional: rank id)); - Example: A command with /permissions add group <user/id> - PermissionsCreateGroup("Admin", 3);
native PermissionsRemoveUser(name[]); - Example: /permissions remove <user/id> PermissionsRemoveUser("Toni"); would remove me from the users.yml.
native PermissionsRemoveGroup(group name[]); - Example: /permissions remove group <group id> PermissionsRemoveGroup("Admin"); would remove the admin group.
native PermissionsSetUserGroup(name[], group name[]) - Example: /permissions set <user/id> group <group id>

groups:
Admin:
info:
rank: 3
permissions:
- 'permissions.node'
- 'permissions.node'
Moderator:
info:
rank: 2
permissions:
- 'permissions.kick'
- 'permissions.modchat'
- 'permissions.modchat.disable'
User:
info:
rank: 1
permissions:
- 'permissions.help'
|
Has anyone ever thought of a global permissions system where any coder could just add one small little hook into each command they have it would be based on a plugin? I was browsing through the Bukkit forums for Minecraft, and I use the Permissions Plugin for everything I have on Minecraft. Well the way it's designed, and how it's used really interests me, and I thought it would be pretty cool if someone attempted to port it to SA:MP. What I thought was kinda based off of what the original Permissions plugin had.
This is what I have so far to write. Yes, it's almost exactly like the Permissions plugin from Bukkit, as I said it's like someone would port it. I'll change updates if I ever come up with more stuff, but I'd like to see what you guys think. |