AclGroupAddACL: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> This fake function is for use with blah & blah and does blahblahblabhalb...) |
mNo edit summary |
||
(12 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{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 --> | ||
This | This function adds the given ACL to the given ACL group. This makes the resources and players in the given ACL group have access to what's specified in the given ACL. The rights for something in the different ACL's in a group are OR-ed together, which means if one ACL gives access to something, this ACL group will have access to that. | ||
==Syntax== | ==Syntax== | ||
<!-- 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 | bool aclGroupAddACL ( aclgroup theGroup, acl theACL ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[aclgroup]]:addACL||}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
<!-- 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:''' The group to add the ACL to | ||
*'''theACL:''' The ACL to add to the group | |||
*''' | |||
===Returns=== | ===Returns=== | ||
<!-- 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 --> | ||
Returns ''true'' if | Returns ''true'' if the ACL could be successfully added to the ACL group, ''false''/''nil'' if either of the elements are invalid, the ACL is already in that group or if something else goes wrong. | ||
==Example== | ==Example== | ||
This example adds a command ''addAclGroup'' with which you can easily add new access control lists to specified acl Groups. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function addAclGroup ( thePlayer, commandName, aclName ) | |||
if(aclName) then | |||
acl = aclCreate ( aclName ) | |||
else | |||
acl = aclCreate("myName") | |||
end | |||
aclGroup = aclGetGroup("Admin") | |||
aclGroupAddACL(aclGroup,acl) -- now all Admins have the rights of acl, too | |||
aclSave () | |||
addCommandHandler ( "addAclGroup", addAclGroup) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
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]] |
Latest revision as of 18:28, 21 February 2021
This function adds the given ACL to the given ACL group. This makes the resources and players in the given ACL group have access to what's specified in the given ACL. The rights for something in the different ACL's in a group are OR-ed together, which means if one ACL gives access to something, this ACL group will have access to that.
Syntax
bool aclGroupAddACL ( aclgroup theGroup, acl theACL )
OOP Syntax Help! I don't understand this!
- Method: aclgroup:addACL(...)
Required Arguments
- theGroup: The group to add the ACL to
- theACL: The ACL to add to the group
Returns
Returns true if the ACL could be successfully added to the ACL group, false/nil if either of the elements are invalid, the ACL is already in that group or if something else goes wrong.
Example
This example adds a command addAclGroup with which you can easily add new access control lists to specified acl Groups.
function addAclGroup ( thePlayer, commandName, aclName ) if(aclName) then acl = aclCreate ( aclName ) else acl = aclCreate("myName") end aclGroup = aclGetGroup("Admin") aclGroupAddACL(aclGroup,acl) -- now all Admins have the rights of acl, too 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