ZH-CN/aclRemoveRight: Difference between revisions
Jump to navigation
Jump to search
Qwe7769611 (talk | contribs) No edit summary |
Qwe7769611 (talk | contribs) No edit summary |
||
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中删除给定的权限(字符串). | |||
== | ==语法== | ||
<!-- 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 aclRemoveRight ( acl theAcl, string rightName ) | bool aclRemoveRight ( acl theAcl, string rightName ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{OOP_ZH-CN||[[acl]]:removeRight||}} | ||
=== | ===必填参数=== | ||
<!-- 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 --> | ||
*'''theAcl:''' | *'''theAcl:''' 要从中移除右侧的ACL | ||
*'''rightName:''' | *'''rightName:''' 要从右侧删除的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中删除,则返回“true”;如果由于某种原因无法删除,即ACL中不存在该权限,则返回“false”或“nil”. | |||
== | ==示例== | ||
此示例在资源启动时删除acl权限. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler("onResourceStart",resourceRoot,function() | addEventHandler("onResourceStart",resourceRoot,function() |
Latest revision as of 07:10, 6 February 2021
此函数用于从给定ACL中删除给定的权限(字符串).
语法
bool aclRemoveRight ( acl theAcl, string rightName )
OOP 语法 什么是OOP?
- 方法: acl:removeRight(...)
必填参数
- theAcl: 要从中移除右侧的ACL
- rightName: 要从右侧删除的ACL名称
返回值
如果给定的权限已成功从给定的ACL中删除,则返回“true”;如果由于某种原因无法删除,即ACL中不存在该权限,则返回“false”或“nil”.
示例
此示例在资源启动时删除acl权限.
addEventHandler("onResourceStart",resourceRoot,function() aclRemoveRight(aclGet("Admin"),"function.setServerPassword") 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