Maptool: Some functions using incorrect test for trusted status causes failure when called by GM in chat

Created on 12 May 2020  ·  8Comments  ·  Source: RPTools/maptool

Describe the bug
If the GM calls a macro from the chat, the macro path should be considered trusted.

However, the macroPathTrusted parser property property is set to false regardless of who typed the macro.

To Reproduce
Steps to reproduce the behavior:

  1. Identify a macro checking permission through isMacroPathTrusted, such as transferVBL().
  2. Run the macro through chat as a GM.
  3. You get the error: You do not have permission to call the "transferVBL" function.

Expected behavior
A GM should have permission to run all macros from chat.

MapTool Info

  • Version: 1.6.1
  • Install: New

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10

Additional context
It's not clear to me why some macros verify permission through isMacroPathTrusted(), which other macros verify permission through isMacroTrusted().

Maybe we should stick to one permission method?

bug macro changes tested

All 8 comments

PR #1815 allows GM to call transferVBL from chat.

The functions remain divided on how trust is evaluated (isMacroPathTrusted vs isMacroTrusted).

The behaviour of isMacroPathTrusted is correct, for this to be true there can be no player editable macros in the chain, nor any typing involved by anyone.

No macro functions should use this as its only for indication in chat purposes (although that my be broken), they should all use isMacroTrusted

The behaviour of isMacroPathTrusted is correct, for this to be true there can be no player editable macros in the chain, nor any typing involved by anyone.

No macro functions should use this as its only for indication in chat purposes (although that my be broken), they should all use isMacroTrusted

If I understand correctly, isMacroTrusted is only used for the say and togm macros, and should never be used to throw a permission exception. Is this correct?

isMacroTrusted -> Used to check if someone can run a macro function or not
isMacroPathTrusted -> Used to determine if certain markup should be added to chat output

PR #1816 fixes this issue by changing isMacroPathTrusted to isMacroTrusted for checking if someone can run a macro function or not.

Functions affected:

  • exportData()
  • herolab.*()
  • log.*()
  • rest.*()
  • transferVBL()

Tested:

  • transferVBL()
  • rest.*
  • exportData()
  • herolab.*
  • log.*

So this is a lesson in, picking the wrong function to call and then copy/pasting your work until someone stops you. :D

IF only someone told me when I did transferVBL back in 1.3.b89 lolz

Was this page helpful?
0 / 5 - 0 ratings