ZH-CN/AclGetName: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
mNo edit summary |
||
Line 38: | Line 38: | ||
==See Also== | ==See Also== | ||
{{ACL_functions}} | {{ACL_functions}} | ||
[[ar:aclGetName]] | |||
[[en:AclGetName]] | [[en:AclGetName]] | ||
[[zh-cn:AclGetName]] |
Latest revision as of 18:24, 21 February 2021
获取给定ACL的名称.
语法
string aclGetName ( acl theAcl )
OOP 语法 什么是OOP?
- 方法: acl:getName(...)
- 变量: .name
必填参数
- theACL: 要获取其名称的ACL
返回值
如果成功,则以字符串形式返回给定ACL的名称。如果不成功,则返回“false”/“nil”,即ACL无效.
示例
此示例添加命令“listacls”,该命令将所有acl的名称列表打印到控制台.
function printOutAllACLs ( thePlayer ) -- 在所有ACL上建立一个表 local allACLs = aclList() -- 如果表里是空白的(代表没有ACL) if #allACLs == 0 then -- 发送消息到控制台并退出函数 return outputConsole ( "There are no ACLs!", thePlayer ) else -- 发送名单列表 outputConsole ( "List of all ACLs:", thePlayer ) for key, singleACL in ipairs ( allACLs ) do local ACLName = aclGetName ( singleACL ) outputConsole ( "- " .. tostring ( ACLName ), thePlayer ) end end end addCommandHandler ( "listacls", printOutAllACLs )
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