ZH-CN/aclGroupAddACL: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> This function adds the given ACL to th...") |
mNo edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
{{Server function}} | {{Server function}} | ||
<!-- Describe in plain english what this function does. Don't go into details, just give an overview --> | <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> | ||
此函数用于将给定ACL添加到给定ACL组。这使得给定ACL组中的资源和玩家可以访问给定ACL中指定的内容.一个组中不同ACL中的某个内容的权限被合并在一起,这意味着如果一个ACL允许访问某个内容,那么这个ACL组将有权访问该内容. | |||
== | ==语法== | ||
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --> | <!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool aclGroupAddACL ( aclgroup theGroup, acl theACL ) | bool aclGroupAddACL ( aclgroup theGroup, acl theACL ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{OOP_ZH-CN||[[aclgroup]]:addACL||}} | ||
=== | ===必填参数=== | ||
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --> | <!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --> | ||
*'''theGroup:''' | *'''theGroup:''' 要将ACL添加到的组 | ||
*'''theACL:''' | *'''theACL:''' 要添加到组的ACL | ||
=== | ===返回值=== | ||
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --> | <!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --> | ||
如果ACL可以成功添加到ACL组,则返回“true”;如果其中任何一个元素无效,则返回“false”/“nil”;如果ACL已在该组中,或出现其他错误,则返回“true”. | |||
== | ==示例== | ||
此示例添加了一个命令“addAclGroup”,使用该命令可以轻松地将新的访问控制列表添加到指定的acl组. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function addAclGroup ( thePlayer, commandName, aclName ) | function addAclGroup ( thePlayer, commandName, aclName ) | ||
Line 29: | Line 29: | ||
end | end | ||
aclGroup = aclGetGroup("Admin") | aclGroup = aclGetGroup("Admin") | ||
aclGroupAddACL(aclGroup,acl) -- | aclGroupAddACL(aclGroup,acl) -- 现在所有的管理员都有acl的权限了 | ||
aclSave () | aclSave () | ||
addCommandHandler ( "addAclGroup", addAclGroup) | addCommandHandler ( "addAclGroup", addAclGroup) | ||
Line 37: | Line 37: | ||
<!-- 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}} | ||
[[ar:aclGroupAddACL]] | |||
[[en:AclGroupAddACL]] | |||
[[zh-cn:aclGroupAddACL]] | [[zh-cn:aclGroupAddACL]] |
Latest revision as of 18:28, 21 February 2021
此函数用于将给定ACL添加到给定ACL组。这使得给定ACL组中的资源和玩家可以访问给定ACL中指定的内容.一个组中不同ACL中的某个内容的权限被合并在一起,这意味着如果一个ACL允许访问某个内容,那么这个ACL组将有权访问该内容.
语法
bool aclGroupAddACL ( aclgroup theGroup, acl theACL )
OOP 语法 什么是OOP?
- 方法: aclgroup:addACL(...)
必填参数
- theGroup: 要将ACL添加到的组
- theACL: 要添加到组的ACL
返回值
如果ACL可以成功添加到ACL组,则返回“true”;如果其中任何一个元素无效,则返回“false”/“nil”;如果ACL已在该组中,或出现其他错误,则返回“true”.
示例
此示例添加了一个命令“addAclGroup”,使用该命令可以轻松地将新的访问控制列表添加到指定的acl组.
function addAclGroup ( thePlayer, commandName, aclName ) if(aclName) then acl = aclCreate ( aclName ) else acl = aclCreate("myName") end aclGroup = aclGetGroup("Admin") aclGroupAddACL(aclGroup,acl) -- 现在所有的管理员都有acl的权限了 aclSave () addCommandHandler ( "addAclGroup", addAclGroup)
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