UpdateResourceACLRequest: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{server function}} This function changes the access for one ACL request of the given resource. Note: This function is protected by default and must be explicitly all...")
 
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{server function}}
{{server function}}
{{New feature/item|3.0120|1.2||
Only available in MTA:SA 1.2 and onwards.
}}
This function changes the access for one ACL request of the given resource.
This function changes the access for one ACL request of the given resource.



Revision as of 02:27, 7 December 2011

Only available in MTA:SA 1.2 and onwards. This function changes the access for one ACL request of the given resource.

Note: This function is protected by default and must be explicitly allowed in the server ACL.

Syntax

bool updateResourceACLRequest ( resource theResource, string rightName, bool access[, string byWho] ) 

Required Arguments

  • theResource: the resource to set the ACL request for.
  • rightName: a string with the name of the right to set the access for. This has to match an existing ACL request.
  • access: a boolean value setting the access. True is for allow, and false for deny.

Optional Arguments

  • byWho: a string value to identity who is changing the setting.

Returns

Returns true if the setting was changed, or false if no change was required or there was a problem with the arguments.

Example

This function will allow all ACL requests from 'theResource'

function allowAllACLRequests(theResource)
  local requests = getResourceACLRequests (theResource)
  for _,request in ipairs(requests) do
    updateResourceACLRequest ( theResource, request.name, true ) 
  end
end

Requirements

Minimum server version 1.2
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.2" />

See Also