AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   Adding additional custom flags to Sourcemod (https://forums.alliedmods.net/showthread.php?t=183079)

Kjaer 04-16-2012 23:03

Adding additional custom flags to Sourcemod
 
I was wondering, is it possible to add addtional custom flags to sourcemod through /config/admin_levels.cfg or even possible at all? Any help would be nice.

Bacardi 04-17-2012 08:08

Re: Adding additional custom flags to Sourcemod
 
Not really.

x00 04-17-2012 08:27

Re: Adding additional custom flags to Sourcemod
 
Quote:

Originally Posted by Kjaer (Post 1690819)
I was wondering, is it possible to add addtional custom flags to sourcemod through /config/admin_levels.cfg or even possible at all? Any help would be nice.

Maybe, take a look at this.
Get the complete source here.

-x00

marty3 07-04-2012 07:59

Re: Adding additional custom flags to Sourcemod
 
I search too

psychonic 07-04-2012 12:01

Re: Adding additional custom flags to Sourcemod
 
You can't add new custom flags, but you can use admin groups and admin group overrides to create the same effect.

rhelgeby 07-04-2012 18:12

Re: Adding additional custom flags to Sourcemod
 
In this case I find the admin system in SourceMod somewhat limited. It would probably be better with named permissions in a hierarchy. A permission entry could look something like this:
Code:

"Permissions"
{
    "MyPermissionGroup"
    {
        "myPlugin.theFeature.anAction" "deny"
    }
}

Then plugins would be able to define custom permissions in this global namespace. Basically a similar system as Bukkit Permissions in Minecraft where you get full control of any feature in any plugin.

asherkin 07-04-2012 18:48

Re: Adding additional custom flags to Sourcemod
 
Minus the hierarchy (although there is grouping), that's exactly what you can do with the extended system.
People get confused enough as it is using just basic overrides.

Dr. McKay 07-04-2012 19:23

Re: Adding additional custom flags to Sourcemod
 
I really don't like the Bukkit style of permissions. When I install a plugin, I want to be able to just override its commands to a flag or two. I don't want to have to go into my permissions file and add an entry for each individual group that I want to have access.

psychonic 07-04-2012 23:18

Re: Adding additional custom flags to Sourcemod
 
Quote:

Originally Posted by Dr. McKay (Post 1743502)
I really don't like the Bukkit style of permissions. When I install a plugin, I want to be able to just override its commands to a flag or two. I don't want to have to go into my permissions file and add an entry for each individual group that I want to have access.

The six provided custom flags are meant for that kind of easiness. Group overrides are then also available if you need something beyond that.

minimoney1 07-05-2012 03:25

Re: Adding additional custom flags to Sourcemod
 
I never got group overrides to work. (Also heard from some people that they never got it working either)
I don't know if this is a bug with SQL admins (pretty sure it's not as I tested with flatfile as well) or if it's a bug with the command grouping feature of Sourcemod (might be this).

.BadGurl AKA FallenAngel 07-05-2012 04:11

Re: Adding additional custom flags to Sourcemod
 
Just use the admin overrides file to make commands for custom flags, I use one to make skins available to public players by using the 'p' flag and then just assign the flag to the player (or group) on sourcebans.

Your admin overrides text file would look like this..


Quote:

Overrides
{
/**
* By default, commands are registered with three pieces of information:
* 1)Command Name (for example, "csdm_enable")
* 2)Command Group Name (for example, "CSDM")
* 3)Command Level (for example, "changemap")
*
* You can override the default flags assigned to individual commands or command groups in this way.
* To override a group, use the "@" character before the name. Example:
* Examples:
* "@CSDM" "b" // Override the CSDM group to 'b' flag
* "csdm_enable" "bgi" // Override the csdm_enable command to 'bgi' flags
*
* Note that for overrides, order is important. In the above example, csdm_enable overwrites
* any setting that csdm_enable previously had.
*
* You can make a command completely public by using an empty flag string.
*/


"sm_admins" "b,z" //Only admins & owners to view online admins
"om_admin_credits" "z" //Owners only
"sm_god" "z" //godmode
"sm_noclip" "z" //noclip
"sm_models" "b,p" //skins
}

rhelgeby 07-05-2012 07:03

Re: Adding additional custom flags to Sourcemod
 
Perhaps it's suitable for commands, but some plugins also have actions or events and need to implement their own set of permissions.

Plugins could just use custom flags to control permissions to specific features, but that may conflict with the same flag in other plugins where you want access to one feature in one plugin, but not in another plugin.

asherkin 07-05-2012 07:04

Re: Adding additional custom flags to Sourcemod
 
Quote:

Originally Posted by rhelgeby (Post 1743781)
Perhaps it's suitable for commands, but some plugins also have actions or events and need to implement their own set of permissions.

Which should be mapped to a string that can be used with both regular and admin group overrides (which allow both a flag as in regular overrides, along with specific "allow" or "deny" access) with CheckCommandAccess.

rhelgeby 07-05-2012 07:11

Re: Adding additional custom flags to Sourcemod
 
So we could just make fake command strings like "myPlugin.myFeature" and override those instead? Though they would still need to be mapped to flags. In some cases it would be enough to just be a member of a group.

asherkin 07-05-2012 07:17

Re: Adding additional custom flags to Sourcemod
 
Quote:

Originally Posted by rhelgeby (Post 1743786)
So we could just make fake command strings like "myPlugin.myFeature" and override those instead? Though they would still need to be mapped to flags. In some cases it would be enough to just be a member of a group.

Yes, although I'd advise using all lowercase and underscores to fit in with everything else (although then they might be confused with commands).

As for default flag mapping, it's just a matter of making sane choices (if it's a public plugin, else just go wild as you know how you'll be setting up overrides).

Some simple default recommendations (for things that don't have a sane equivalent flag of their own):
Public: 0
Any admin: Generic
No-one: Root

One silly thing some people do that could screw this up: Give other people the Root flag.
It's basically designed as a complete override to the admin system, for the server console.

Dr. McKay 07-05-2012 11:22

Re: Adding additional custom flags to Sourcemod
 
Quote:

Originally Posted by asherkin (Post 1743791)
One silly thing some people do that could screw this up: Give other people the Root flag.
It's basically designed as a complete override to the admin system, for the server console.

It amazes me when people post here saying that they give all their admins root because they don't want to set up permissions then they ask how to prevent admins from doing x or y.

Smarmy 07-07-2012 15:56

Re: Adding additional custom flags to Sourcemod
 
Quote:

Originally Posted by Dr. McKay (Post 1743942)
It amazes me when people post here saying that they give all their admins root because they don't want to set up permissions then they ask how to prevent admins from doing x or y.

It's like the process of elimination, done admin permissions style.

Give everyone all permissions and then find out who will abuse what and only remove those permissions from said abusive admins.


All times are GMT -4. The time now is 05:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.