AclList: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Qwe7769611 (talk | contribs) No edit summary |
||
(12 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function returns a list of all the ACLs. | |||
This function returns a list | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table | table aclList () | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP|This function is a static function underneath the ACL class.|[[ACL]].list||}} | |||
===Returns=== | ===Returns=== | ||
Returns a table of all the ACLs. This table can be empty if no ACLs exist. It can also return ''false''/''nil'' if it failed for some reason. | |||
Returns a table | |||
==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 | |||
return outputConsole ( "There are no ACLs!", thePlayer ) | |||
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}} | ||
[[ | [[zh-cn:aclList]] |
Latest revision as of 08:36, 5 February 2021
This function returns a list of all the ACLs.
Syntax
table aclList ()
OOP Syntax Help! I don't understand this!
- Note: This function is a static function underneath the ACL class.
- Method: ACL.list(...)
Returns
Returns a table of all the ACLs. This table can be empty if no ACLs exist. It can also return false/nil if it failed for some reason.
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 return outputConsole ( "There are no ACLs!", thePlayer ) 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