AclGroupRemoveACL: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}  
{{Server function}}  
{{Needs Example}}
<!-- 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 function removes the given ACL from the given ACL group.
This function removes the given ACL from the given ACL group.
Line 21: Line 20:


==Example==  
==Example==  
<!-- Explain what the example is in a single sentance -->
This example outputs to the console if the Admin acl was removed from the Moderator ACL Group.
This example does...
<syntaxhighlight lang="lua">addEventHandler("onResourceStart",resourceRoot,function()
<!-- 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 -->
if(aclGroupRemoveACL(aclGetGroup("Moderator"),aclGet("Admin")))then
<syntaxhighlight lang="lua">
outputConsole("The Admin acl was removed from the Moderator group.")-- If it was successfully removed
--TODO
else
outputConsole("Unsuccessful... Admin might have been removed from the Moderator group before.")-- if it was removed before or didn't existed
end
end)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 04:10, 27 April 2012

This function removes the given ACL from the given ACL group.

Syntax

bool aclGroupRemoveACL ( aclgroup theGroup, acl theACL )

Required Arguments

  • theGroup: The group to remove the given ACL from
  • theACL: The ACL to remove from the given group

Returns

Returns true if the ACL was successfully removed from the ACL group, false/nil if it could not be removed for some reason, ie. either of the elements were invalid.

Example

This example outputs to the console if the Admin acl was removed from the Moderator ACL Group.

addEventHandler("onResourceStart",resourceRoot,function()
	if(aclGroupRemoveACL(aclGetGroup("Moderator"),aclGet("Admin")))then
		outputConsole("The Admin acl was removed from the Moderator group.")-- If it was successfully removed
	else
		outputConsole("Unsuccessful... Admin might have been removed from the Moderator group before.")-- if it was removed before or didn't existed
	end
end)	

See Also