Difference between revisions of "Template:LSL Function/permission"

From Second Life Wiki
Jump to navigation Jump to search
(clarify "no way to revoke")
m
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{#if:
{{#if:
{{#vardefine:header_footnote|{{#var:header_footnote}}{{#if: {{{1|}}}| Requires the [[{{{1}}}]] permission{{#ifeq:{{{grant|anyone}}}|anyone||, granted by {{{grant|anyone}}},}} to run.}}}}
 
{{#vardefine:caveats|{{#var:caveats}}{{#if: {{{1|<noinclude>*</noinclude>}}}|
{{{{#if:{{#var:DEBUG_CHANNEL}}||:DEBUG_CHANNEL}}|}}
 
{{#vardefine:header_footnote|{{#var:header_footnote}}{{#if:{{{1|<noinclude>*</noinclude>}}}|To run this function the script must request the [[{{{1}}}]] {{#if:{{{2|}}}|or [[{{{2}}}]]}} permission with [[llRequestPermissions]]{{#ifeq:{{{grant|anyone}}}|anyone||&#32;and it must be granted by {{{grant|anyone}}}}}.}}}}
 
{{#vardefine:caveats|{{#var:caveats}}{{#if:{{{1|<noinclude>*</noinclude>}}}|{{PBR}}
<div style="border: 1px dotted rgba(0,0,0,0.5);">{{Collapsible_Table/Simple|title=<h5 style="margin:0;">Permissions</h5>|table-style=width:100%;|autocollapse=*|content={{!}}<div>
* Do not depend upon the auto-grant status of permissions. '''Always''' use the [[run_time_permissions]] event.
* Do not depend upon the auto-grant status of permissions. '''Always''' use the [[run_time_permissions]] event.
* If the script lacks the permission [[{{{1}}}]], the script will shout an error on {{LSL Const|DEBUG_CHANNEL|integer|2147483647|hex=0x7FFFFFFF}} and the operation fails (but the script continues to run).{{#ifeq:{{{grant|anyone<noinclude>*</noinclude>}}}|anyone||
* If the script lacks {{#if:{{{2|}}}|both the permissions [[{{{1}}}]] and [[{{{2}}}]]|the permission [[{{{1}}}]]}}, the script will shout an error on {{#var:DEBUG_CHANNEL}} and the operation fails (but the script continues to run).{{#ifeq:{{{grant|anyone<noinclude>*</noinclude>}}}|anyone||
* If [[{{{1}}}]] is granted by anyone other than {{{grant|anyone}}}, then when the function is called an error will be shouted on {{LSL Const|DEBUG_CHANNEL|integer|2147483647|hex=0x7FFFFFFF}}.}}}}
* If [[{{{1}}}]] {{#if:{{{2|}}}|or [[{{{2}}}]]}} is granted by anyone other than {{{grant|anyone}}}, then when the function is called an error will be shouted on {{#var:DEBUG_CHANNEL}}.}}
* Once the [[{{{1}}}]] permission is granted there is no way to revoke it except from inside the script (for example, with a new [[llRequestPermissions]] call). Otherwise, the script will only lose the permission if it is reset or the object derezzed (deleted, detached, or taken).}}
{{{caveats|}}}{{LSL Function/permission/caveat switch|{{{1}}}}}{{#if:{{{2|}}}|{{LSL Function/permission/caveat switch|{{{2}}}}}}}</div>}}</div>}}}}
 
{{#vardefine:also_events|{{#var:also_events}}
{{#vardefine:also_events|{{#var:also_events}}
{{LSL DefineRow||[[run_time_permissions]]|Permission receiving event}}}}
{{LSL DefineRow||[[run_time_permissions]]|Permission receiving event}}}}
Line 14: Line 20:
{{#vardefine:also_articles|{{#var:also_articles}}
{{#vardefine:also_articles|{{#var:also_articles}}
{{LSL DefineRow||[[:Category:LSL Permissions/Script|Script permissions]]|}}}}
{{LSL DefineRow||[[:Category:LSL Permissions/Script|Script permissions]]|}}}}
}}<includeonly>{{#ifeq:{{{mode|}}}{{#var:mode}}|request||[[Category:LSL Requires Permissions]]}}</includeonly><noinclude>
 
<includeonly>{{#if:{{{nc|}}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||[[Category:LSL Requires Permissions]]}}
}}}}</includeonly>
 
}}<noinclude>
{| {{Prettytable}}
{| {{Prettytable}}
|-{{Hl2}}
|-{{Hl2}}
! Name
! #var
! Value
! value
|-
|-
|header_footnote
{{VarPair|header_footnote}}
|{{#var:header_footnote}}
|-
|-
|caveats
{{VarPair|caveats}}
|{{#var:caveats}}
|-
|-
|also_events
{{VarPairTable|also_events}}
|
{|
{{#var:also_events}}
|}
|-
|-
|also_functions
{{VarPairTable|also_functions}}
|
{|
{{#var:also_functions}}
|}
|-
|-
|also_articles
{{VarPairTable|also_articles}}
|
{|
{{#var:also_articles}}
|}
|}
|}
</noinclude>
</noinclude>

Latest revision as of 18:37, 11 May 2016

#var value
header_footnote To run this function the script must request the [[{{{1}}}]] permission with llRequestPermissions.
caveats
Permissions
  • Do not depend upon the auto-grant status of permissions. Always use the run_time_permissions event.
  • If the script lacks the permission [[{{{1}}}]], the script will shout an error on DEBUG_CHANNEL and the operation fails (but the script continues to run).
  • If [[{{{1}}}]] is granted by anyone other than anyone, then when the function is called an error will be shouted on DEBUG_CHANNEL.
  • Once the [[{{{1}}}]] permission is granted there is no way to revoke it except from inside the script (for example, with a new llRequestPermissions call) or the script is reset or deleted.
also_events
•  run_time_permissions Permission receiving event
also_functions
•  llGetPermissions Get the permissions granted
•  llGetPermissionsKey Get the agent who granted permissions
•  llRequestPermissions Request permissions
also_articles
•  Script permissions