ZH-CN/aclListRights: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} This function returns a table of all the rights that a given ACL has. ==Syntax== <syntaxhighlight lang="lua"> table aclListRights ( acl theACL...") |
Qwe7769611 (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
此函数返回给定ACL拥有的所有权限的表. | |||
== | ==语法== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table aclListRights ( acl theACL, string allowedType ) | table aclListRights ( acl theACL, string allowedType ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{OOP_ZH-CN||[[acl]]:listRights||}} | ||
=== | ===必填参数=== | ||
*'''theACL:''' | *'''theACL:''' 要从中获取权限的ACL | ||
*'''allowedType:''' | *'''allowedType:''' 允许的正确类型.可能的值为 ''general'', ''function'', ''resource'' and ''command'' | ||
=== | ===返回值=== | ||
在给定ACL中以字符串形式返回权限上的表。这张表子可能是空的。如果acl无效或由于其他原因失败,则返回“false”或“nil”. | |||
== | ==示例== | ||
本例输出给定acl的权限.(已测试!) | |||
<syntaxhighlight lang="lua">addCommandHandler("aclRights",function(player,command,theAcl) | <syntaxhighlight lang="lua">addCommandHandler("aclRights",function(player,command,theAcl) | ||
if(theAcl~="")then | if(theAcl~="")then | ||
Line 35: | Line 35: | ||
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --> | <!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --> | ||
{{ACL_functions}} | {{ACL_functions}} | ||
[[ | [[en:aclListRights]] |
Latest revision as of 07:05, 6 February 2021
此函数返回给定ACL拥有的所有权限的表.
语法
table aclListRights ( acl theACL, string allowedType )
OOP 语法 什么是OOP?
- 方法: acl:listRights(...)
必填参数
- theACL: 要从中获取权限的ACL
- allowedType: 允许的正确类型.可能的值为 general, function, resource and command
返回值
在给定ACL中以字符串形式返回权限上的表。这张表子可能是空的。如果acl无效或由于其他原因失败,则返回“false”或“nil”.
示例
本例输出给定acl的权限.(已测试!)
addCommandHandler("aclRights",function(player,command,theAcl) if(theAcl~="")then rights = aclListRights(aclGet(theAcl)) count = 0 for acl,list in pairs(rights)do outputChatBox("ACL List: "..theAcl.." #"..tostring(count).." Right: "..list..".",player) count = count + 1 end else outputChatBox("Please type in a acl that you want to retrieve the rights from.",player) outputChatBox("Please use this Syntax: /aclRights theACL ",player) end end)
See Also
- aclCreate
- aclCreateGroup
- aclDestroy
- aclDestroyGroup
- aclGet
- aclGetGroup
- aclGetName
- aclGetRight
- aclGroupAddACL
- aclGroupAddObject
- aclGroupGetName
- aclGroupList
- aclGroupListACL
- aclGroupListObjects
- aclGroupRemoveACL
- aclGroupRemoveObject
- aclList
- aclListRights
- aclReload
- aclRemoveRight
- aclSave
- aclSetRight
- hasObjectPermissionTo
- isObjectInACLGroup