use of br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules in project mamute by caelum.
the class TagPageController method editTagPage.
@Post
@CustomBrutauthRules(ModeratorOnlyRule.class)
public void editTagPage(String tagName, MarkedText about) {
TagPage tagPage = tagPages.findByTag(tagName);
tagPage.setAbout(about);
if (!validator.validate(tagPage)) {
validator.onErrorRedirectTo(TagPageController.class).editTagPageForm(tagPage.getTagName());
return;
}
result.redirectTo(this).showTagPage(tagPage.getTagName());
}
use of br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules in project mamute by caelum.
the class TagPageController method editTagPageForm.
@Get
@CustomBrutauthRules(ModeratorOnlyRule.class)
public void editTagPageForm(String tagName) {
TagPage tagPage = tagPages.findByTag(tagName);
result.include("tagPage", tagPage);
}
use of br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules in project mamute by caelum.
the class WatchController method watch.
@Post
@CustomBrutauthRules(LoggedRule.class)
public void watch(Long watchableId, String type) {
Watchable watchable = watchers.findWatchable(watchableId, mapping.getClassFor(type));
User user = currentUser.getCurrent();
Watcher watcher = new Watcher(user);
watchers.addOrRemove(watchable, watcher);
result.nothing();
}
use of br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules in project mamute by caelum.
the class HibernateStatisticsController method show.
@Get("/alsjkdalkjsjdhadskj")
@CustomBrutauthRules(ModeratorOnlyRule.class)
public void show() {
Statistics statistics = sf.getStatistics();
result.include("s", statistics);
}
use of br.com.caelum.brutauth.auth.annotations.CustomBrutauthRules in project mamute by caelum.
the class NewsController method saveEdit.
@Post
@CustomBrutauthRules(EditNewsRule.class)
public void saveEdit(@Load News news, String title, MarkedText description, String comment) {
Information newInformation = new NewsInformation(title, description, currentUser, comment);
news.enqueueChange(newInformation, UpdateStatus.NO_NEED_TO_APPROVE);
result.redirectTo(this).showNews(news, news.getSluggedTitle());
}
Aggregations