import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
import static org.sonar.server.permission.ws.Parameters.createGroupIdParameter;
import static org.sonar.server.permission.ws.Parameters.createGroupNameParameter;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
public class AddGroupToTemplateAction implements PermissionsWsAction {
.setHandler(this);
createTemplateKeyParameter(action);
- createPermissionParameter(action);
+ createProjectPermissionParameter(action);
createGroupIdParameter(action);
createGroupNameParameter(action);
}
import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
import static org.sonar.server.permission.ws.Parameters.PARAM_USER_LOGIN;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
import static org.sonar.server.permission.ws.Parameters.createUserLoginParameter;
.setHandler(this);
createTemplateKeyParameter(action);
- createPermissionParameter(action);
+ createProjectPermissionParameter(action);
createUserLoginParameter(action);
}
package org.sonar.server.permission.ws;
import org.sonar.api.server.ws.WebService.NewAction;
-import org.sonar.core.permission.ProjectPermissions;
import org.sonar.core.permission.GlobalPermissions;
+import org.sonar.core.permission.ProjectPermissions;
class Parameters {
"</ul>",
GlobalPermissions.ALL_ON_ONE_LINE,
ProjectPermissions.ALL_ON_ONE_LINE);
+ private static final String PROJECT_PERMISSION_PARAM_DESCRIPTION = String.format("Permission" +
+ "<ul>" +
+ "<li>Possible values for project permissions %s</li>" +
+ "</ul>",
+ ProjectPermissions.ALL_ON_ONE_LINE);
private Parameters() {
// static methods only
.setRequired(true);
}
+ static void createProjectPermissionParameter(NewAction action) {
+ action.createParam(PARAM_PERMISSION)
+ .setDescription(PROJECT_PERMISSION_PARAM_DESCRIPTION)
+ .setRequired(true);
+ }
+
static void createGroupNameParameter(NewAction action) {
action.createParam(PARAM_GROUP_NAME)
.setDescription("Group name or 'anyone' (case insensitive)")
import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
import static org.sonar.server.permission.ws.Parameters.createGroupIdParameter;
import static org.sonar.server.permission.ws.Parameters.createGroupNameParameter;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
public class RemoveGroupFromTemplateAction implements PermissionsWsAction {
.setHandler(this);
createTemplateKeyParameter(action);
- createPermissionParameter(action);
+ createProjectPermissionParameter(action);
createGroupIdParameter(action);
createGroupNameParameter(action);
}
import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
import static org.sonar.server.permission.ws.Parameters.PARAM_USER_LOGIN;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
import static org.sonar.server.permission.ws.Parameters.createUserLoginParameter;
.setHandler(this);
createTemplateKeyParameter(action);
- createPermissionParameter(action);
+ createProjectPermissionParameter(action);
createUserLoginParameter(action);
}