As a Roblox developer, it is currently too hard to design code that respects the security locking of Instances cleanly.
The best solution so far is to run tostring under a pcall then hackily see if it works.
local function SecurityCheck(inst)
return pcall(tostring, inst)
I shouldn’t need to elaborate on why this isn’t clean or efficient, and its tremendously hacky. Let me give you a place where we need the ability to manually security check an Instance:
Selections
The selection API is an amazing interface with Plugins to allow us to see what the developer is selecting, however, the Selection:Get
also returns security-locked instances that plugins cant access. This can create compatibility issues if we cant check if the instance can be accessed.
This also extends to methods, however I cant find a strong usecase here outside of feature-completeness
If Roblox is able to address this issue, it would improve my development experience because I would be able to design code that can cleanly handle instances that cant be accessed by plugins.