Roblox UtilitiesDevlHub Roblox Documentation

Data type

SecurityCapabilities

A set of SecurityCapability items. See script capabilities.

An immutable set of SecurityCapability values that controls which engine APIs and actions a script inside a sandboxed container can access. Assign a SecurityCapabilities value to an instance's Capabilities property to restrict the scripts beneath it.

Capability enforcement takes effect when Workspace.SandboxedInstanceMode is set to SandboxedInstanceMode.Experimental.

Constructors 2#

newReturns a new set of capabilities from zero or more SecurityCapability items.
fromCurrentReturns a new set of capabilities from the capabilities of the calling function.

new(...: SecurityCapability)#

Returns a new set of capabilities from zero or more SecurityCapability items.

Luau
local capabilities = SecurityCapabilities.new(Enum.SecurityCapability.Players,
    Enum.SecurityCapability.Animation,
    Enum.SecurityCapability.Basic)

local newScript = Instance.new("Script")
newScript.Capabilities = capabilities
NameTypeDefaultDescription
...SecurityCapabilityZero or more SecurityCapability values to include in the new set.

fromCurrent()#

Returns a new set of capabilities from the capabilities of the calling function.

Methods 6#

AddReturns a new set of capabilities with zero or more additions.
AddReturns a new set of capabilities with the provided set added.
RemoveReturns a new set of capabilities with zero or more deletions.
RemoveReturns a new set of capabilities with the provided set deleted.
ContainsReturns whether a set of capabilities contains the specified SecurityCapability items.
ContainsReturns whether a set of capabilities contains another set of capabilities.

Add(...: SecurityCapability): SecurityCapabilities#

Returns a new set of capabilities with zero or more additions. If you add SecurityCapability items that are already present, they are not duplicated.

NameTypeDefaultDescription
...SecurityCapabilityZero or more SecurityCapability values to add to the set.
Returns
  • SecurityCapabilities — A new set containing the union of the original capabilities and the specified additions.

Add(capabilities: SecurityCapabilities): SecurityCapabilities#

Returns a new set of capabilities with the provided set added. If you add SecurityCapability items that are already present, they are not duplicated.

NameTypeDefaultDescription
capabilitiesSecurityCapabilitiesA SecurityCapabilities set whose items are added to the original.
Returns

Remove(...: SecurityCapability): SecurityCapabilities#

Returns a new set of capabilities with zero or more deletions. SecurityCapability items not present in the original set are ignored.

NameTypeDefaultDescription
...SecurityCapabilityZero or more SecurityCapability values to remove from the set.
Returns

Remove(capabilities: SecurityCapabilities): SecurityCapabilities#

Returns a new set of capabilities with the provided set deleted. SecurityCapability items not present in the original set are ignored.

NameTypeDefaultDescription
capabilitiesSecurityCapabilitiesA SecurityCapabilities set whose items are removed from the original.

Contains(...: SecurityCapability): boolean#

Returns whether a set of capabilities contains the specified SecurityCapability items. The set must contain all provided items to return true.

NameTypeDefaultDescription
...SecurityCapabilityZero or more SecurityCapability values to check for membership in the set.
Returns
  • boolean

Contains(capabilities: SecurityCapabilities): boolean#

Returns whether a set of capabilities contains another set of capabilities. The set must contain all items in the provided set to return true.

NameTypeDefaultDescription
capabilitiesSecurityCapabilitiesA SecurityCapabilities set to check for membership in the original set.
Returns
  • boolean