Security - Maple Help

Home : Support : Online Help : System : Security : Security/Test

Security

 Test
 test if an operation is permitted

 Calling Sequence Test( op, file )

Parameters

 op - a name representing operation file - a file name as a string

Description

 • This routine tests if the operation op on the file file is permitted, when tested against the current security settings. Security need not be enabled in order to test the operation.
 • The Test command returns true if the operation in op on the file file is permitted under the current Security settings, and false otherwise.
 • The operation op must be one of: read, write, or extcall.
 • For an overview of Maple engine security and an explanation of relevant concepts, see the Maple Engine Security help page.

Examples

 > $\mathrm{Security}:-\mathrm{Config}\left(\mathrm{SECURE_READ_LIST}=\left["/tmp/*"\right]\right):$
 > $\mathrm{Security}:-\mathrm{Test}\left(\mathrm{read},"/tmp/file1"\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{Security}:-\mathrm{Test}\left(\mathrm{read},"/usr/file1"\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{Security}:-\mathrm{Test}\left(\mathrm{write},"/tmp/file1"\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{Security}:-\mathrm{Test}\left(\mathrm{extcall},"/tmp/file1"\right)$
 ${\mathrm{false}}$ (4)