import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
try (DbSession dbSession = dbClient.openSession(false)) {
UserId user = support.findUser(dbSession, request.mandatoryParam(PARAM_USER_LOGIN));
Optional<ComponentDto> project = support.findProject(dbSession, request);
- String organizationKey = request.param(PARAM_ORGANIZATION_KEY);
+ String organizationKey = request.param(PARAM_ORGANIZATION);
checkArgument(!project.isPresent() || organizationKey == null, "Organization must not be set when project is set.");
OrganizationDto org = project
.map(dto -> dbClient.organizationDao().selectByUuid(dbSession, dto.getOrganizationUuid()))
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
public class GroupsAction implements PermissionsWsAction {
@Override
public void handle(Request request, Response response) throws Exception {
try (DbSession dbSession = dbClient.openSession(false)) {
- OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION_KEY));
+ OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION));
Optional<ProjectId> projectId = support.findProjectId(dbSession, request);
checkProjectAdmin(userSession, org.getUuid(), projectId);
import static org.sonar.server.ws.WsUtils.checkFound;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
public class PermissionWsSupport {
public GroupIdOrAnyone findGroup(DbSession dbSession, Request request) {
Long groupId = request.paramAsLong(PARAM_GROUP_ID);
- String orgKey = request.param(PARAM_ORGANIZATION_KEY);
+ String orgKey = request.param(PARAM_ORGANIZATION);
String groupName = request.param(PARAM_GROUP_NAME);
GroupWsRef groupRef = GroupWsRef.create(groupId, orgKey, groupName);
return groupWsSupport.findGroupOrAnyone(dbSession, groupRef);
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
}
public static void createOrganizationParameter(NewAction action) {
- action.createParam(PARAM_ORGANIZATION_KEY)
+ action.createParam(PARAM_ORGANIZATION)
.setDescription("Key of organization, used when group name is set")
.setExampleValue("my-org")
.setSince("6.2")
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
try (DbSession dbSession = dbClient.openSession(false)) {
UserId user = support.findUser(dbSession, request.mandatoryParam(PARAM_USER_LOGIN));
Optional<ProjectId> projectId = support.findProjectId(dbSession, request);
- OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION_KEY));
+ OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION));
checkProjectAdmin(userSession, org.getUuid(), projectId);
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createOrganizationParameter;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
import static org.sonarqube.ws.WsPermissions.Permission.newBuilder;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
public class SearchGlobalPermissionsAction implements PermissionsWsAction {
@Override
public void handle(Request wsRequest, Response wsResponse) throws Exception {
try (DbSession dbSession = dbClient.openSession(false)) {
- OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION_KEY));
+ OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION));
checkGlobalAdmin(userSession, org.getUuid());
WsSearchGlobalPermissionsResponse response = buildResponse(dbSession, org);
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
import static org.sonar.server.ws.WsUtils.checkRequest;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
public class UsersAction implements PermissionsWsAction {
@Override
public void handle(Request request, Response response) throws Exception {
try (DbSession dbSession = dbClient.openSession(false)) {
- OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION_KEY));
+ OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION));
Optional<ProjectId> projectId = support.findProjectId(dbSession, request);
checkProjectAdmin(userSession, org.getUuid(), projectId);
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
AddProjectCreatorToTemplateWsRequest wsRequest = AddProjectCreatorToTemplateWsRequest.builder()
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME))
.build();
validateProjectPermission(wsRequest.getPermission());
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateRef;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
.setLogin(request.mandatoryParam(PARAM_USER_LOGIN))
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME));
}
import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateRef;
import static org.sonar.server.ws.WsParameterBuilder.createRootQualifierParameter;
import static org.sonar.server.ws.WsParameterBuilder.QualifierParameterContext.newQualifierParameterContext;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
private static BulkApplyTemplateWsRequest toBulkApplyTemplateWsRequest(Request request) {
return new BulkApplyTemplateWsRequest()
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME))
.setQualifier(request.param(PARAM_QUALIFIER))
.setQuery(request.param(Param.TEXT_QUERY));
import static org.sonar.server.ws.WsUtils.writeProtobuf;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_DESCRIPTION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY_PATTERN;
public class CreateTemplateAction implements PermissionsWsAction {
.setName(request.mandatoryParam(PARAM_NAME))
.setDescription(request.param(PARAM_DESCRIPTION))
.setProjectKeyPattern(request.param(PARAM_PROJECT_KEY_PATTERN))
- .setOrganizationKey(request.param(PARAM_ORGANIZATION_KEY));
+ .setOrganizationKey(request.param(PARAM_ORGANIZATION));
}
private static CreateTemplateWsResponse buildResponse(PermissionTemplateDto permissionTemplateDto) {
import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateRef;
import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
private static DeleteTemplateWsRequest toDeleteTemplateWsRequest(Request request) {
return new DeleteTemplateWsRequest()
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME));
}
import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
RemoveProjectCreatorFromTemplateWsRequest wsRequest = RemoveProjectCreatorFromTemplateWsRequest.builder()
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME))
.build();
validateProjectPermission(wsRequest.getPermission());
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
.setPermission(request.mandatoryParam(PARAM_PERMISSION))
.setLogin(request.mandatoryParam(PARAM_USER_LOGIN))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME));
}
import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createOrganizationParameter;
import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
public class SearchTemplatesAction implements PermissionsWsAction {
private static final String PROPERTY_PREFIX = "projects_role.";
@Override
public void handle(Request wsRequest, Response wsResponse) throws Exception {
try (DbSession dbSession = dbClient.openSession(false)) {
- OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION_KEY));
+ OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION));
SearchTemplatesWsRequest request = new SearchTemplatesWsRequest()
.setOrganizationUuid(org.getUuid())
.setQuery(wsRequest.param(Param.TEXT_QUERY));
import static org.sonar.server.ws.WsParameterBuilder.createRootQualifierParameter;
import static org.sonar.server.ws.WsParameterBuilder.QualifierParameterContext.newQualifierParameterContext;
import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
return new SetDefaultTemplateWsRequest()
.setQualifier(request.param(PARAM_QUALIFIER))
.setTemplateId(request.param(PARAM_TEMPLATE_ID))
- .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+ .setOrganization(request.param(PARAM_ORGANIZATION))
.setTemplateName(request.param(PARAM_TEMPLATE_NAME));
}
import org.sonar.api.server.ws.Request;
import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
public static WsTemplateRef fromRequest(Request wsRequest) {
String uuid = wsRequest.param(PARAM_TEMPLATE_ID);
- String organization = wsRequest.param(PARAM_ORGANIZATION_KEY);
+ String organization = wsRequest.param(PARAM_ORGANIZATION);
String name = wsRequest.param(PARAM_TEMPLATE_NAME);
return new WsTemplateRef(uuid, organization, name);
import static org.sonar.db.component.ComponentTesting.newView;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
loginAsAdmin(org);
newRequest()
- .setParam(PARAM_ORGANIZATION_KEY, org.getKey())
+ .setParam(PARAM_ORGANIZATION, org.getKey())
.setParam(PARAM_GROUP_NAME, group.getName())
.setParam(PARAM_PERMISSION, PROVISIONING)
.execute();
newRequest()
.setParam(PARAM_GROUP_NAME, groupDto.getName())
.setParam(PARAM_PERMISSION, permission)
- .setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey())
+ .setParam(PARAM_ORGANIZATION, organizationDto.getKey())
.execute();
}
import static org.sonar.db.component.ComponentTesting.newFileDto;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.db.component.ComponentTesting.newView;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
OrganizationDto organization = db.organizations().insert();
loginAsAdmin(organization);
newRequest()
- .setParam(PARAM_ORGANIZATION_KEY, organization.getKey())
+ .setParam(PARAM_ORGANIZATION, organization.getKey())
.setParam(PARAM_USER_LOGIN, user.getLogin())
.setParam(PARAM_PERMISSION, SYSTEM_ADMIN)
.execute();
newRequest()
.setParam(PARAM_USER_LOGIN, user.getLogin())
.setParam(PARAM_PROJECT_KEY, project.getKey())
- .setParam(PARAM_ORGANIZATION_KEY, "an_org")
+ .setParam(PARAM_ORGANIZATION, "an_org")
.setParam(PARAM_PERMISSION, ISSUE_ADMIN)
.execute();
}
.setParam(PARAM_USER_LOGIN, userDto.getLogin())
.setParam(PARAM_PERMISSION, permission);
if (organizationDto != null) {
- request.setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey());
+ request.setParam(PARAM_ORGANIZATION, organizationDto.getKey());
}
request.execute();
}
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
newRequest()
.setParam(PARAM_GROUP_NAME, groupDto.getName())
.setParam(PARAM_PERMISSION, permission)
- .setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey())
+ .setParam(PARAM_ORGANIZATION, organizationDto.getKey())
.execute();
}
import static org.sonar.db.component.ComponentTesting.newFileDto;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.db.component.ComponentTesting.newView;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
newRequest()
.setParam(PARAM_USER_LOGIN, userDto.getLogin())
.setParam(PARAM_PERMISSION, permission)
- .setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey())
+ .setParam(PARAM_ORGANIZATION, organizationDto.getKey())
.execute();
}
import static org.mockito.Mockito.mock;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.db.component.ComponentTesting.newView;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
+ "' is not found (case insensitive) in organization with key '" + otherOrganization.getKey() + "'");
newRequest()
- .setParam(PARAM_ORGANIZATION_KEY, otherOrganization.getKey())
+ .setParam(PARAM_ORGANIZATION, otherOrganization.getKey())
.setParam(PARAM_TEMPLATE_NAME, template1.getName())
.execute();
}
loginAsAdmin(organization);
newRequest()
- .setParam(PARAM_ORGANIZATION_KEY, organization.getKey())
+ .setParam(PARAM_ORGANIZATION, organization.getKey())
.setParam(PARAM_TEMPLATE_NAME, template1.getName())
.execute();
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
private TestResponse newRequestByName(WsActionTester actionTester, @Nullable String organizationKey, @Nullable String name) throws Exception {
TestRequest request = actionTester.newRequest().setMethod("POST");
if (organizationKey != null) {
- request.setParam(PARAM_ORGANIZATION_KEY, organizationKey);
+ request.setParam(PARAM_ORGANIZATION, organizationKey);
}
if (name != null) {
request.setParam(PARAM_TEMPLATE_NAME, name);
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.resources.Qualifiers.PROJECT;
import static org.sonar.api.resources.Qualifiers.VIEW;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
loginAsAdmin(organization);
newRequest()
- .setParam(PARAM_ORGANIZATION_KEY, organization.getKey())
+ .setParam(PARAM_ORGANIZATION, organization.getKey())
.setParam(PARAM_TEMPLATE_NAME, template.getName().toUpperCase())
.execute();
db.getSession().commit();
public static final String CONTROLLER = "api/permissions";
public static final String PARAM_PERMISSION = "permission";
- public static final String PARAM_ORGANIZATION_KEY = "organization";
+ public static final String PARAM_ORGANIZATION = "organization";
public static final String PARAM_GROUP_NAME = "groupName";
public static final String PARAM_GROUP_ID = "groupId";
public static final String PARAM_PROJECT_ID = "projectId";