Tabnine Logo
Contract.getRoles
Code IndexAdd Tabnine to your IDE (free)

How to use
getRoles
method
in
com.icodici.universa.contract.Contract

Best Java code snippets using com.icodici.universa.contract.Contract.getRoles (Showing top 5 results out of 315)

origin: UniversaBlockchain/universa

Map<String, Role> contractRoles = contract.getRoles();
result = roles.isEmpty() || roles.stream().anyMatch(role -> contractRoles.containsKey(role));
origin: UniversaBlockchain/universa

private static void doAnonymize() throws IOException {
  List<String> sources = new ArrayList<String>((List) options.valuesOf("anonymize"));
  List<String> roles = new ArrayList<String>((List) options.valuesOf("role"));
  List<String> names = (List) options.valuesOf("output");
  List<String> nonOptions = new ArrayList<String>((List) options.nonOptionArguments());
  for (String opt : nonOptions) {
    sources.addAll(asList(opt.split(",")));
  }
  cleanNonOptionalArguments(sources);
  for (int s = 0; s < sources.size(); s++) {
    String source = sources.get(s);
    Contract contract = loadContract(source);
    if (contract != null) {
      if(roles.size() <= 0) {
        roles = new ArrayList<>(contract.getRoles().keySet());
      }
      for (String roleName : roles) {
        report("Anonymizing role " + roleName + " in " + source + "...");
        contract.anonymizeRole(roleName);
        contract.seal();
      }
      if (names.size() > s) {
        saveContract(contract, names.get(s), true, false);
      } else {
        saveContract(contract, new FilenameTool(source).addSuffixToBase("_anonymized").toString(), true, false);
      }
    }
  }
  finish();
}
origin: UniversaBlockchain/universa

});
report("\nWhich can play roles:\n");
contract.getRoles().forEach((name, role) -> {
  String canPlay = role.isAllowedForKeys(keys) ? "✔" : "✘";
  report("\t" + canPlay + " " + role.getName());
origin: UniversaBlockchain/universa

Map<String, Role> roles = c.getRoles();
assertEquals(owner, roles.get("owner").getKeyRecord());
assertEquals(issuer, roles.get("issuer").getKeyRecord());
origin: UniversaBlockchain/universa

c.getRoles().remove("issuer");
c.seal();
c.getRoles().remove("creator");
c.seal();
c.getRoles().remove("owner");
c.seal();
c.getRoles().remove("creator");
c.registerRole(new RoleLink("creator", "owner"));
c.seal();
c.getRoles().remove("owner");
c.getRoles().clear();
c.registerRole(new RoleLink("issuer", "creator"));
c.registerRole(new RoleLink("creator", "owner"));
com.icodici.universa.contractContractgetRoles

Javadoc

Get roles of the contract

Popular methods of Contract

  • <init>
    Extract old, deprecated v2 self-contained binary partially unpacked by the TransactionPack, and fill
  • addNewItems
    Add one or more siblings to the contract. Note that those must be sealed before calling #seal() or #
  • addSignerKey
    Add private key to keys contract binary to be signed with when sealed next time. It is called before
  • getExpiresAt
    Get contract expiration time
  • getId
    Get the id sealing self if need
  • getPackedTransaction
    Pack the contract to the most modern .unicon format, same as TransactionPack#pack(). Uses bounded Tr
  • registerRole
    Register new role. Name must be unique otherwise existing role will be overwritten
  • seal
    Seal contract to binary. This call adds signatures from #getKeysToSignWith()
  • addSignatureToSeal
    Add signature to sealed (before) contract. Do not deserializing or changing contract bytes, but will
  • check
  • createRevision
    Create new revision to be changed, signed sealed and then ready to approve. Created "revision" contr
  • fromDslFile
    Create contract importing its parameters with passed .yaml file. No signatures are added automatical
  • createRevision,
  • fromDslFile,
  • fromPackedTransaction,
  • getCreatedAt,
  • getDefinition,
  • getErrors,
  • getKeysToSignWith,
  • getLastSealedBinary,
  • getNew,
  • getNewItems

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTextField (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now