Package com.atlassian.jira.rest.client.api.domain

Examples of com.atlassian.jira.rest.client.api.domain.Permission


    final Integer id = json.getInt("id");
    final String key = json.getString("key");
    final String name = json.getString("name");
    final String description = json.getString("description");
    final boolean havePermission = json.getBoolean("havePermission");
    return new Permission(id, key, name, description, havePermission);
  }
View Full Code Here


    final PermissionsJsonParser parser = new PermissionsJsonParser();
    final Permissions permissions = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/mypermission/valid.json"));

    assertThat(permissions.havePermission("WORKLOG_EDIT_OWN"), is(true));
    assertThat(permissions.havePermission("WORKLOG_DELETE_OWN"), is(false));
    Permission worklogDeleteOwn = permissions.getPermission("WORKLOG_DELETE_OWN");
    assertThat(worklogDeleteOwn, notNullValue());
    assertThat(worklogDeleteOwn.getId(), is(42));
    assertThat(worklogDeleteOwn.getKey(), is("WORKLOG_DELETE_OWN"));
    assertThat(worklogDeleteOwn.getName(), is("Delete Own Worklogs"));
    assertThat(worklogDeleteOwn.getDescription(), is("Ability to delete own worklogs made on issues."));
    assertThat(worklogDeleteOwn.havePermission(), is(false));
  }
View Full Code Here

    final List<Permission> permissions = Lists.newArrayList();
    final Iterator it = permissionsObject.keys();
    while (it.hasNext()) {
      final String key = it.next().toString();
      final JSONObject permissionObject = permissionsObject.getJSONObject(key);
      final Permission permission = permissionJsonParser.parse(permissionObject);
      permissions.add(permission);
    }
    return new Permissions(permissions);
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.Permission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.