IsPlayerAceAllowed: How does it works?

So, I have been trying to see and understand how does IsPlayerAceAllowed works.

My permissions in server.cfg looks like this:

add_ace group.admin menu.admin allow
add_ace group.moderator menu.moderator allow
add_ace group.developer menu.developer allow
add_principal identifier.steam:1100001096a1e35 group.admin
add_principal identifier.steam:1100001096a1e35 group.moderator
add_principal identifier.steam:1100001096a1e35 group.developer

And every time that I call one of the following, I always get false:

API.IsPlayerAceAllowed(MyPlayerObject.Handle, "menu.admin");
API.IsPlayerAceAllowed(MyPlayerObject.Handle, "menu.moderator");
API.IsPlayerAceAllowed(MyPlayerObject.Handle, "menu.developer");
API.IsPlayerAceAllowed(MyPlayerObject.Handle, "group.admin");
API.IsPlayerAceAllowed(MyPlayerObject.Handle, "group.moderator");
API.IsPlayerAceAllowed(MyPlayerObject.Handle, "group.developer");

Why is always false? There is something wrong with the function or am I doing something wrong?

Have you looked through this guide:

?

Yeah, specially the “Principals: Command syntax” and " Ace-command syntax" sections.

Part of the list_aces command:

group.admin -> menu.admin = ALLOW
group.developer -> menu.developer = ALLOW
group.moderator -> menu.moderator = ALLOW
1 Like

I don’t see anything wrong with the way you setup the permissions, so my theory is that something wonky gets passed into IsPlayerAceAllowed, Maybe MyPlayerObject.Handle is off or incorrect? :thinking:

MyPlayerObject is generated on the server from LocalPlayer.Handle on the client side, so MyPlayerObject.Handle should be the same as LocalPlayer.Handle.

And you are sure that identifier.steam:1100001096a1e35 is the correct steam id? :confused:
I mean if you are on localhost, you can even do: identifier.ip:127.0.0.1.

Also cutting down the possible cases would be wise:

add_ace group.admin menu.admin allow
add_principal identifier.steam:1100001096a1e35 group.admin
...
API.IsPlayerAceAllowed(MyPlayerObject.Handle, "menu.admin");

See if that works

1100001096a1e35 is 76561198118215221, and that matches my profile ID so yea, is correct.

Well, the problem is specifically with IsPlayerAceAllowed. I know this because other commands that require group.admin work without problems (like restart).

Well, I did nothing other than building again both server and client but they work (even if Player.Handle is not the same).