mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
199 lines
7.9 KiB
YAML
199 lines
7.9 KiB
YAML
# This file is automatically generated. Please don't edit it manually.
|
||
# To submit a bug report on the content, see
|
||
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
|
||
|
||
name: PolicyService
|
||
type: class
|
||
memory_category: Instances
|
||
summary: |
|
||
Helps you query information regarding policy compliance for players around the
|
||
world based on age range, location, and platform type.
|
||
description: |
|
||
`PolicyService` helps you query information regarding policy compliance for
|
||
players around the world based on age range, location, and platform type.
|
||
code_samples: []
|
||
inherits:
|
||
- Instance
|
||
descendants: []
|
||
tags:
|
||
- NotCreatable
|
||
- Service
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
properties: []
|
||
methods:
|
||
- name: PolicyService:CanViewBrandProjectAsync
|
||
summary: |
|
||
Determines if a user can see brand project assets inside your experience.
|
||
description: |
|
||
Determines if a user can see brand project assets inside your experience.
|
||
This method lets you work with brands to only show commercial assets to
|
||
brand-compliant audiences.
|
||
|
||
To use `CanViewBrandProjectAsync`, you must use a brand project ID
|
||
provided by Roblox. To request a brand project ID,
|
||
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfGTRQwATB2wUg0P4HUSTtyXrhptFahJifo1ew84SyqtfSBfg/viewform">contact
|
||
us</a>.
|
||
|
||
You must call this method on a server-side Script and wrap it in a
|
||
`Global.LuaGlobals.pcall()`.
|
||
code_samples:
|
||
- PolicyService-BrandProjectIntegrationServer
|
||
- PolicyService-BrandProjectIntegrationClient
|
||
parameters:
|
||
- name: player
|
||
type: Player
|
||
default:
|
||
summary: |
|
||
The `Player` object you're trying to show the brand project to.
|
||
- name: brandProjectId
|
||
type: string
|
||
default:
|
||
summary: |
|
||
The brand project ID provided by Roblox. Represents all assets
|
||
associated with a brand project.
|
||
returns:
|
||
- type: boolean
|
||
summary: |
|
||
Whether or not the brand project can be shown to the specific user.
|
||
tags:
|
||
- Yields
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Basic
|
||
- name: PolicyService:GetPolicyInfoForPlayerAsync
|
||
summary: |
|
||
Returns policy information about a player based on geolocation, age group,
|
||
and platform.
|
||
description: |
|
||
Returns policy information about a player based on geolocation, age group,
|
||
and platform. The structure of the returned dictionary is as follows:
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
<th>Type</th>
|
||
<th>Required for</th>
|
||
<th>Description</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><code>AreAdsAllowed</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that includes <a href="../../../production/monetization/immersive-ads.md">immersive ads</a>.</td>
|
||
<td>When <code>true</code>, the player might see immersive ads within an experience.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>ArePaidRandomItemsRestricted</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that has paid random items.</td>
|
||
<td>When <code>true</code>, the player can <b>not</b> interact with paid random item generators, either via in‑experience currency bought with Robux or Robux directly.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>AllowedExternalLinkReferences</code></td>
|
||
<td>Array</td>
|
||
<td>Any experience that references external links.</td>
|
||
<td>A list of external link references such as social media links, handles, or iconography that a player is permitted to see. Possible values include <code>"Discord"</code>, <code>"Facebook"</code>, <code>"Twitch"</code>, <code>"YouTube"</code>, <code>"X"</code>, <code>"GitHub"</code>, and <code>"Guilded"</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>IsContentSharingAllowed</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any feature in the experience that enables users to create content (e.g. text, images, video, audio) that other users can see in the experience or allows user to share content within experiences.</td>
|
||
<td>When <code>true</code>, the player can use features related to sharing UGC within an experience, such as uploading a screen capture, sharing a video, or posting an image to a content feed that other users can see.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>IsEligibleToPurchaseCommerceProduct</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that wants to sell <a href="../../../production/monetization/commerce-products.md">commerce products</a>.</td>
|
||
<td>When <code>true</code>, the player is eligible to purchase commerce products within an experience.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>IsEligibleToPurchaseSubscription</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that wants to sell subscriptions.</td>
|
||
<td>When <code>true</code>, the player is eligible to purchase subscriptions within an experience.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>IsPaidItemTradingAllowed</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that allows users to purchase virtual items that they can trade with other players.</td>
|
||
<td>When <code>true</code>, the player can trade virtual items that they purchased with in-experience currency or Robux.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>IsPhotoToAvatarAllowed</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that uses the Photo-to-Avatar APIs.</td>
|
||
<td>When <code>true</code>, the Photo-to-Avatar API `Class.AvatarCreationService: PromptSelectAvatarGenerationImageAsync()` is available to the player.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><code>IsSubjectToChinaPolicies</code></td>
|
||
<td>Boolean</td>
|
||
<td>Any experience that is available in China.</td>
|
||
<td>When <code>true</code>, an experience should enforce compliance changes. See <a href="https://devforum.roblox.com/t/new-programs-available-roblox-china-licensed-to-operate/1023361">this forum post</a> for more information.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
##### Exceptions
|
||
|
||
Like any async call, this method needs to be wrapped in
|
||
`Global.LuaGlobals.pcall()` and error-handled properly. A full list of
|
||
possible error messages and their reasons is:
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Message</th>
|
||
<th>Reason</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>Instance was not a player</td>
|
||
<td>The <code>player</code> parameter is not a <code>Class.Player</code> instance.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Players not found</td>
|
||
<td>Internal error that the <code>Class.Players</code> object is missing.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>This method cannot be called on the client for a non-local player</td>
|
||
<td>This method cannot be called on the client for a non-local <code>Class.Player</code>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>GetPolicyInfoForPlayerAsync is called too many times</td>
|
||
<td>Internal error that <code>GetPolicyInfoForPlayerAsync()</code> is called more than 100 (current setting) times before an HTTP response comes back.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
See also `Class.LocalizationService:GetCountryRegionForPlayerAsync()`
|
||
which returns a country/region code string according to the player's
|
||
client IP geolocation.
|
||
code_samples:
|
||
- getting-policy-information-for-a-player
|
||
- getting-policy-for-a-player-for-commerce-products
|
||
parameters:
|
||
- name: player
|
||
type: Instance
|
||
default:
|
||
summary: |
|
||
The `Class.Player` to get policy information for.
|
||
returns:
|
||
- type: Dictionary
|
||
summary: |
|
||
A dictionary containing information about the policy information of
|
||
the requested player; see above for the dictionary structure.
|
||
tags:
|
||
- Yields
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Basic
|
||
events: []
|
||
callbacks: []
|