:SetAuthorizationCallback

Sets a single, powerful function on the server that acts as a central security checkpoint for all client data requests. This callback is your primary tool for controlling precisely which players can access which data keys.

When a client attempts to :Request() or :Listen() to a realKey, this function is invoked on the server. You can then implement any logic you need.


DataReplicator:SetAuthorizationCallback(callback)

callback: ((player: Player, realKey: string) -> boolean)?

  • A function that takes the Player object initiating the request and the realKey (string) they are trying to access.

  • It must return true if access is allowed, or false if it should be denied.

  • Pass nil to remove the current authorization callback.

Last updated