use of com.jd.blockchain.ledger.PrivilegeSet in project jdchain-core by blockchain-jd-com.
the class RolePrivilegeDataset method getRolePrivilege.
/**
* 查询角色权限;
*
* <br>
* 如果不存在,则返回 null;
*
* @param address
* @return
*/
@Override
public RolePrivileges getRolePrivilege(String roleName) {
// 只返回最新版本;
Bytes key = encodeKey(roleName);
DataEntry<Bytes, byte[]> kv = dataset.getDataEntry(key);
if (kv == null) {
return null;
}
PrivilegeSet privilege = BinaryProtocol.decode(kv.getValue());
return new RolePrivileges(roleName, kv.getVersion(), privilege);
}
Aggregations