AclObjectGetGroups: Difference between revisions
Jump to navigation
Jump to search
m (Added "New Feature" template) |
m (Improved example) |
||
Line 25: | Line 25: | ||
outputChatBox('Groups:', player) | outputChatBox('Groups:', player) | ||
local groups = aclObjectGetGroups('user.'..getAccountName(account)) | |||
for _,v in ipairs( | for _,v in ipairs(groups) do | ||
outputChatBox('* '..aclGroupGetName(v)) | outputChatBox('* '..aclGroupGetName(v)) | ||
end | end |
Latest revision as of 06:27, 19 October 2023
Syntax
table aclObjectGetGroups ( string object )
Required Arguments
- object: The name of the ACL entry to get groups of
Returns
Returns a table of all groups the object is in on success, false if something went wrong.
Examples
This example outputs a list of all groups of the calling user
Click to collapse [-]
addCommandHandler("listGroups",function(player) local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return end outputChatBox('Groups:', player) local groups = aclObjectGetGroups('user.'..getAccountName(account)) for _,v in ipairs(groups) do outputChatBox('* '..aclGroupGetName(v)) end end)
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