AclGetName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
Get the name of given ACL. | Get the name of given ACL. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string aclGetName ( acl theAcl ) | string aclGetName ( acl theAcl ) | ||
Line 11: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theACL:''' The ACL to get the name of | *'''theACL:''' The ACL to get the name of | ||
===Returns=== | ===Returns=== | ||
Returns the name of the given ACL as a string if successful. Returns ''false''/''nil'' if unsuccessful, ie the ACL is invalid. | Returns the name of the given ACL as a string if successful. Returns ''false''/''nil'' if unsuccessful, ie the ACL is invalid. | ||
==Example== | ==Example== | ||
This example adds a command ''listacls'' which prints out a name list of all ACLs to the console. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function printOutAllACLs ( thePlayer ) | ||
-- get a table over all the ACLs | |||
local allACLs = aclList() | |||
-- if the table is empty (there are no ACLs) | |||
if #allACLs == 0 then | |||
-- print out a message to console and exit function | |||
outputConsole ( "There are no ACLs!", thePlayer ) | |||
return | |||
else | |||
-- print out a list of the names | |||
outputConsole ( "List of all ACLs:", thePlayer ) | |||
for key, singleACL in ipairs ( allACLs ) do | |||
local ACLName = aclGetName ( singleACL ) | |||
outputConsole ( "- " .. tostring ( ACLName ), thePlayer ) | |||
end | |||
end | |||
end | |||
addCommandHandler ( "listacls", printOutAllACLs ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ACL_functions}} | {{ACL_functions}} | ||
Revision as of 18:42, 22 June 2009
Get the name of given ACL.
Syntax
string aclGetName ( acl theAcl )
Required Arguments
- theACL: The ACL to get the name of
Returns
Returns the name of the given ACL as a string if successful. Returns false/nil if unsuccessful, ie the ACL is invalid.
Example
This example adds a command listacls which prints out a name list of all ACLs to the console.
function printOutAllACLs ( thePlayer ) -- get a table over all the ACLs local allACLs = aclList() -- if the table is empty (there are no ACLs) if #allACLs == 0 then -- print out a message to console and exit function outputConsole ( "There are no ACLs!", thePlayer ) return else -- print out a list of the names outputConsole ( "List of all ACLs:", thePlayer ) for key, singleACL in ipairs ( allACLs ) do local ACLName = aclGetName ( singleACL ) outputConsole ( "- " .. tostring ( ACLName ), thePlayer ) end end end addCommandHandler ( "listacls", printOutAllACLs )
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