コード例 #1
0
  public void execute(XmlDoc.Element args, Inputs in, Outputs out, XmlWriter w) throws Throwable {
    // Get arguments and parse
    XmlDoc.Element authority = args.element("authority");
    String domain = args.value("domain");
    String user = args.value("user");
    Collection<String> roles = args.values("role");
    Collection<String> pssdRoles = args.values("pssd-role");
    if (roles == null && pssdRoles == null) {
      throw new Exception("You must supply a 'role' and/or 'pssd-role'.");
    }

    // Do the work
    Boolean grant = false;
    SvcUserRoleGrant.grantRevoke(executor(), authority, domain, user, roles, pssdRoles, w, grant);
  }
コード例 #2
0
  public void execute(XmlDoc.Element args, Inputs in, Outputs out, XmlWriter w) throws Throwable {

    /*
     * get the cid argument value
     */
    String id = args.value("cid");
    /*
     * build the args for om.pssd.object.describe service.
     */
    XmlDocMaker dm = new XmlDocMaker("args");
    dm.add("id", id);
    /*
     * call om.pssd.object.describe service.
     */
    XmlDoc.Element r = executor().execute("om.pssd.object.describe", dm.root());
    /*
     * return the result.
     */
    w.add(r.element("object"));
  }
コード例 #3
0
  public void execute(XmlDoc.Element args, Inputs in, Outputs out, XmlWriter w) throws Throwable {

    // Add the role ID on
    XmlDoc.Element role = args.element("role");
    PSSDUtils.checkRoleExists(executor(), role.value(), true);
    SvcRoleMemberRegAdd.addRoleID(executor(), role);

    // Find the registry asset. If does not exist yet return silently.
    String id =
        AssetRegistry.findRegistry(
            executor(), SvcRoleMemberRegAdd.REGISTRY_ASSET_NAME, AssetRegistry.AccessType.PUBLIC);
    if (id == null) return;

    // See if role already exists
    Boolean checkTopName = true;
    String docId =
        AssetRegistry.checkExists(executor(), id, SvcRoleMemberRegAdd.DOCTYPE, role, checkTopName);

    // Remove the role
    if (docId != null) {
      AssetRegistry.removeItem(executor(), id, docId, role, SvcRoleMemberRegAdd.DOCTYPE);
      w.add("id", id);
    }
  }