ZH-CN/aclListRights: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
Qwe7769611 (talk | contribs) No edit summary |
||
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 |
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