remove label api
This commit is contained in:
committed by
Ezequiel Bergamaschi
parent
c8e0b92ef5
commit
b79930394d
@@ -18,4 +18,6 @@ public interface LabelService {
|
||||
Label getLabelById(int id);
|
||||
|
||||
public Label getLabelByTitle(@NotNull String title, @NotNull final User user);
|
||||
|
||||
void removeLabel(@NotNull final Label label, @NotNull final User user) throws WiseMappingException;
|
||||
}
|
||||
|
@@ -40,4 +40,14 @@ public class LabelServiceImpl implements LabelService {
|
||||
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
|
||||
return labelManager.getLabelByTitle(title, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLabel(@NotNull Label label, @NotNull User user) throws WiseMappingException {
|
||||
if (label.getCreator().equals(user)) {
|
||||
labelManager.removeLabel(label);
|
||||
} else {
|
||||
throw new WiseMappingException("User: "+ user.getFullName() + "has no ownership on label " + label.getTitle());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user