AclGroupAddACL: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(7 intermediate revisions by 5 users not shown)
Line 9: Line 9:
bool aclGroupAddACL ( aclgroup theGroup, acl theACL )
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 -->
Line 19: Line 19:
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.
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==
<!-- Explain what the example is in a single sentance -->
This example adds a command ''addAclGroup'' with which you can easily add new access control lists to specified acl Groups.
This example does...
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--TODO
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 30: 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}}
[[Category:Needs_Example]]
 
[[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