- Documentation
- Server functions
- aclSetRight
Function
aclSetRight
Sets a right on a list. Right names: "command.name", "function.name", "resource.name" or your own ("general.name"). The fourth argument sets an expiry.
Syntax
bool aclSetRight(acl theAcl, string rightName, bool hasAccess [, int expiresInMs = nil])Arguments
theAclacl- The list.
rightNamestring- Right name.
hasAccessbooltrueallows,falsedenies.expiresInMsint, optional = nil- After how many milliseconds the right expires.Not in MTA:SA
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
aclSetRight(acl theAcl, string rightName, bool hasAccess)Returns
true on success.
Example
aclSetRight(aclGet("VIP"), "general.vip_garage", true, 30 * 24 * 60 * 60 * 1000)
See also
aclGetRightChecks whether a list grants a right. Also returnsfalsewhen there is no entry.aclRemoveRightRemoves a right entry from a list.hasObjectPermissionToChecks whether an object has a right. It first looks at the ACL lists of the object's groups; if none has an entry, theadmins.xmllevels decide, and finally the default value.