-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of root flags in RequirePermissionsOr #700
base: main
Are you sure you want to change the base?
Conversation
public override bool CanExecuteCommand(SteamID? steamID) | ||
{ | ||
if (caller == null) return true; | ||
if (AdminManager.PlayerHasCommandOverride(caller, Command)) | ||
if (steamID == null) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this reliable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be. SteamID null checks are peppered throughout core AdminManager functions, including PlayerHasCommandOverride itself, and I haven't seen any bug reports these functions failing.
@@ -27,13 +27,15 @@ public BaseRequiresPermissions(params string[] permissions) | |||
Command = ""; | |||
} | |||
|
|||
public virtual bool CanExecuteCommand(CCSPlayerController? caller) | |||
public virtual bool CanExecuteCommand(SteamID? steamID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a public API? We might need to keep the old prototype around for backwards compatibility, and then proxy it to the new method using caller.AuthorizedSteamID
Addresses #699.