mirror of
https://github.com/sismics/docs.git
synced 2025-12-27 00:22:33 +00:00
#65: Vocabulary modification for admin only
This commit is contained in:
@@ -74,7 +74,6 @@ public class UserResource extends BaseResource {
|
||||
@FormParam("password") String password,
|
||||
@FormParam("email") String email,
|
||||
@FormParam("storage_quota") String storageQuotaStr) {
|
||||
|
||||
if (!authenticate()) {
|
||||
throw new ForbiddenClientException();
|
||||
}
|
||||
@@ -132,7 +131,6 @@ public class UserResource extends BaseResource {
|
||||
public Response update(
|
||||
@FormParam("password") String password,
|
||||
@FormParam("email") String email) {
|
||||
|
||||
if (!authenticate()) {
|
||||
throw new ForbiddenClientException();
|
||||
}
|
||||
@@ -176,7 +174,6 @@ public class UserResource extends BaseResource {
|
||||
@FormParam("password") String password,
|
||||
@FormParam("email") String email,
|
||||
@FormParam("storage_quota") String storageQuotaStr) {
|
||||
|
||||
if (!authenticate()) {
|
||||
throw new ForbiddenClientException();
|
||||
}
|
||||
@@ -225,7 +222,6 @@ public class UserResource extends BaseResource {
|
||||
@Path("check_username")
|
||||
public Response checkUsername(
|
||||
@QueryParam("username") String username) {
|
||||
|
||||
UserDao userDao = new UserDao();
|
||||
User user = userDao.getActiveByUsername(username);
|
||||
|
||||
@@ -255,7 +251,6 @@ public class UserResource extends BaseResource {
|
||||
@FormParam("username") String username,
|
||||
@FormParam("password") String password,
|
||||
@FormParam("remember") boolean longLasted) {
|
||||
|
||||
// Validate the input data
|
||||
username = StringUtils.strip(username);
|
||||
password = StringUtils.strip(password);
|
||||
|
||||
@@ -17,6 +17,7 @@ import javax.ws.rs.core.Response.Status;
|
||||
|
||||
import com.sismics.docs.core.dao.jpa.VocabularyDao;
|
||||
import com.sismics.docs.core.model.jpa.Vocabulary;
|
||||
import com.sismics.docs.rest.constant.BaseFunction;
|
||||
import com.sismics.rest.exception.ForbiddenClientException;
|
||||
import com.sismics.rest.util.ValidationUtil;
|
||||
|
||||
@@ -66,6 +67,7 @@ public class VocabularyResource extends BaseResource {
|
||||
if (!authenticate()) {
|
||||
throw new ForbiddenClientException();
|
||||
}
|
||||
checkBaseFunction(BaseFunction.ADMIN);
|
||||
|
||||
// Validate input data
|
||||
name = ValidationUtil.validateLength(name, "name", 1, 50, false);
|
||||
@@ -107,6 +109,7 @@ public class VocabularyResource extends BaseResource {
|
||||
if (!authenticate()) {
|
||||
throw new ForbiddenClientException();
|
||||
}
|
||||
checkBaseFunction(BaseFunction.ADMIN);
|
||||
|
||||
// Validate input data
|
||||
name = ValidationUtil.validateLength(name, "name", 1, 50, true);
|
||||
@@ -157,6 +160,7 @@ public class VocabularyResource extends BaseResource {
|
||||
if (!authenticate()) {
|
||||
throw new ForbiddenClientException();
|
||||
}
|
||||
checkBaseFunction(BaseFunction.ADMIN);
|
||||
|
||||
// Get the vocabulary
|
||||
VocabularyDao vocabularyDao = new VocabularyDao();
|
||||
|
||||
Reference in New Issue
Block a user