Search in sources :

Example 1 with UserPrivilegeSet

use of com.jd.blockchain.ledger.UserPrivilegeSet in project jdchain-core by blockchain-jd-com.

the class ContractLedgerQueryService method getUserPrivileges.

@Override
public UserPrivilegeSet getUserPrivileges(String userAddress) {
    LedgerDataSet ledgerDataQuery = ledgerQuery.getLedgerDataSet();
    LedgerAdminDataSet previousAdminDataset = ledgerDataQuery.getAdminDataset();
    LedgerSecurityManager securityManager = new LedgerSecurityManagerImpl(previousAdminDataset.getAdminSettings().getRolePrivileges(), previousAdminDataset.getAdminSettings().getAuthorizations(), previousAdminDataset.getParticipantDataset(), ledgerDataQuery.getUserAccountSet());
    UserPrivilegeSet userPrivilegeSet = securityManager.getUserRolesPrivilegs(Bytes.fromBase58(userAddress));
    return userPrivilegeSet;
}
Also used : LedgerSecurityManager(com.jd.blockchain.ledger.core.LedgerSecurityManager) UserPrivilegeSet(com.jd.blockchain.ledger.UserPrivilegeSet) LedgerAdminDataSet(com.jd.blockchain.ledger.core.LedgerAdminDataSet) LedgerSecurityManagerImpl(com.jd.blockchain.ledger.core.LedgerSecurityManagerImpl) LedgerDataSet(com.jd.blockchain.ledger.core.LedgerDataSet)

Example 2 with UserPrivilegeSet

use of com.jd.blockchain.ledger.UserPrivilegeSet in project jdchain-core by blockchain-jd-com.

the class UncommittedLedgerQueryService method getUserPrivileges.

@Override
public UserPrivilegeSet getUserPrivileges(String userAddress) {
    LedgerDataSet ledgerDataQuery = transactionContext.getDataset();
    LedgerAdminDataSet previousAdminDataset = ledgerDataQuery.getAdminDataset();
    LedgerSecurityManager securityManager = new LedgerSecurityManagerImpl(previousAdminDataset.getAdminSettings().getRolePrivileges(), previousAdminDataset.getAdminSettings().getAuthorizations(), previousAdminDataset.getParticipantDataset(), ledgerDataQuery.getUserAccountSet());
    UserPrivilegeSet userPrivilegeSet = securityManager.getUserRolesPrivilegs(Bytes.fromBase58(userAddress));
    return userPrivilegeSet;
}
Also used : LedgerSecurityManager(com.jd.blockchain.ledger.core.LedgerSecurityManager) UserPrivilegeSet(com.jd.blockchain.ledger.UserPrivilegeSet) LedgerAdminDataSet(com.jd.blockchain.ledger.core.LedgerAdminDataSet) LedgerSecurityManagerImpl(com.jd.blockchain.ledger.core.LedgerSecurityManagerImpl) LedgerDataSet(com.jd.blockchain.ledger.core.LedgerDataSet)

Aggregations

UserPrivilegeSet (com.jd.blockchain.ledger.UserPrivilegeSet)2 LedgerAdminDataSet (com.jd.blockchain.ledger.core.LedgerAdminDataSet)2 LedgerDataSet (com.jd.blockchain.ledger.core.LedgerDataSet)2 LedgerSecurityManager (com.jd.blockchain.ledger.core.LedgerSecurityManager)2 LedgerSecurityManagerImpl (com.jd.blockchain.ledger.core.LedgerSecurityManagerImpl)2