Here are the examples of the java api play.mvc.Security.USERNAME taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
8 Examples
14
Source : InternalProblemStatementAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result renderMediaById(Http.Request req, long problemId, String mediaFilename) {
String actorJid = req.attrs().get(Security.USERNAME);
Problem problem = checkFound(problemStore.findProblemById(problemId));
String mediaUrl = problemStore.getStatementMediaFileURL(actorJid, problem.getJid(), mediaFilename);
return okAsImage(req, mediaUrl);
}
14
Source : InternalProblemStatementAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result downloadStatementMediaFile(Http.Request req, long id, String filename) {
String actorJid = req.attrs().get(Security.USERNAME);
Problem problem = checkFound(problemStore.findProblemById(id));
String mediaUrl = problemStore.getStatementMediaFileURL(actorJid, problem.getJid(), filename);
return okAsDownload(mediaUrl);
}
14
Source : InternalProblemEditorialAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result downloadEditorialMediaFile(Http.Request req, long id, String filename) {
String actorJid = req.attrs().get(Security.USERNAME);
Problem problem = checkFound(problemStore.findProblemById(id));
String mediaUrl = problemStore.getEditorialMediaFileURL(actorJid, problem.getJid(), filename);
return okAsDownload(mediaUrl);
}
14
Source : InternalProblemEditorialAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result renderMediaById(Http.Request req, long problemId, String mediaFilename) {
String actorJid = req.attrs().get(Security.USERNAME);
Problem problem = checkFound(problemStore.findProblemById(problemId));
String mediaUrl = problemStore.getEditorialMediaFileURL(actorJid, problem.getJid(), mediaFilename);
return okAsImage(req, mediaUrl);
}
14
Source : InternalLessonStatementAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result renderMediaById(Http.Request req, long lessonId, String mediaFilename) {
String actorJid = req.attrs().get(Security.USERNAME);
Lesson lesson = checkFound(lessonStore.findLessonById(lessonId));
String mediaUrl = lessonStore.getStatementMediaFileURL(actorJid, lesson.getJid(), mediaFilename);
return okAsImage(req, mediaUrl);
}
14
Source : InternalLessonStatementAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result downloadStatementMediaFile(Http.Request req, long id, String filename) {
String actorJid = req.attrs().get(Security.USERNAME);
Lesson lesson = checkFound(lessonStore.findLessonById(id));
String mediaUrl = lessonStore.getStatementMediaFileURL(actorJid, lesson.getJid(), filename);
return okAsDownload(mediaUrl);
}
13
Source : InternalProgrammingProblemGradingAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result downloadGradingTestDataFile(Http.Request req, long problemId, String filename) {
String actorJid = req.attrs().get(Security.USERNAME);
Problem problem = checkFound(problemStore.findProblemById(problemId));
checkAllowed(problemRoleChecker.isAllowedToManageGrading(req, problem));
String testDataUrl = programmingProblemStore.getGradingTestDataFileURL(actorJid, problem.getJid(), filename);
return okAsDownload(testDataUrl);
}
13
Source : InternalProgrammingProblemGradingAPIController.java
with GNU General Public License v2.0
from ia-toki
with GNU General Public License v2.0
from ia-toki
@Transactional(readOnly = true)
public Result downloadGradingHelperFile(Http.Request req, long problemId, String filename) {
String actorJid = req.attrs().get(Security.USERNAME);
Problem problem = checkFound(problemStore.findProblemById(problemId));
checkAllowed(problemRoleChecker.isAllowedToManageGrading(req, problem));
String helper = programmingProblemStore.getGradingHelperFileURL(actorJid, problem.getJid(), filename);
return okAsDownload(helper);
}