20#include <xrpld/app/misc/DelegateUtils.h>
22#include <xrpl/protocol/STArray.h>
31 auto const permissionArray = delegate->getFieldArray(sfPermissions);
34 for (
auto const& permission : permissionArray)
36 auto const permissionValue = permission[sfPermissionValue];
37 if (permissionValue == txPermission)
53 auto const permissionArray = delegate->getFieldArray(sfPermissions);
54 for (
auto const& permission : permissionArray)
56 auto const permissionValue = permission[sfPermissionValue];
57 auto const granularValue =
61 if (type && *type == txType)
62 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.
TxType
Transaction type identifiers.
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.
TER checkTxPermission(std::shared_ptr< SLE const > const &delegate, STTx const &tx)
Check if the delegate account has permission to execute the transaction.
GranularPermissionType
We have both transaction type permissions and granular type permissions.
TERSubset< CanCvtToTER > TER