Share via


SqlDataDictionaryPermission.new Method

Creates a new instance of the SQLDataDictionaryPermission class.

Syntax

public void new(IdentifierName methodName)

Run On

Called

Parameters

Examples

The following code example deletes the data in the xRefNames table.

server static void main(Args _args) 
{ 
    DictTable dictTable = new DictTable(tablenum(xRefNames)); 
    str sqlTableName; 
    SqlDataDictionary sqlTable; 
 
    if (dictTable && dictTable.enabled()) 
    { 
        sqlTableName = dictTable.name(DbBackend::Sql); 
        sqlTable = new SqlDataDictionary(); 
        // Only try to truncate if the table does exist 
        // in the SQL database 
        if (sqlTable.tableExist(sqlTableName)) 
        { 
            new SqlDataDictionaryPermission( 
                methodstr(SqlDataDictionary, tableTruncate)).assert(); 
            sqlTable.tableTruncate(tablenum(xRefNames)); 
            CodeAccessPermission::revertAssert(); 
        } 
    } 
}

See Also

SqlDataDictionaryPermission Class

CodeAccessPermission Class

How to: Secure an API on the AOS

Secured APIs