1#include <xrpl/protocol/STArray.h>
2#include <xrpl/tx/transactors/Delegate/DelegateUtils.h>
11 auto const permissionArray = delegate->getFieldArray(sfPermissions);
14 for (
auto const& permission : permissionArray)
16 auto const permissionValue = permission[sfPermissionValue];
17 if (permissionValue == txPermission)
33 auto const permissionArray = delegate->getFieldArray(sfPermissions);
34 for (
auto const& permission : permissionArray)
36 auto const permissionValue = permission[sfPermissionValue];
39 if (type && *type == txType)
40 granularPermissions.
insert(granularValue);
std::optional< TxType > getGranularTxType(GranularPermissionType const &gpType) const
static Permission const & getInstance()
TxType getTxnType() const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
@ terNO_DELEGATE_PERMISSION
TxType
Transaction type identifiers.
GranularPermissionType
We have both transaction type permissions and granular type permissions.
void loadGranularPermission(std::shared_ptr< SLE const > const &delegate, TxType const &type, std::unordered_set< GranularPermissionType > &granularPermissions)
Load the granular permissions granted to the delegate account for the specified transaction type.
NotTEC checkTxPermission(std::shared_ptr< SLE const > const &delegate, STTx const &tx)
Check if the delegate account has permission to execute the transaction.
TERSubset< CanCvtToNotTEC > NotTEC