use of org.sagebionetworks.bridge.models.accounts.UserSession in project BridgeServer2 by Sage-Bionetworks.
the class AppConfigElementsController method getElementRevisions.
@GetMapping("/v3/appconfigs/elements/{id}")
public ResourceList<AppConfigElement> getElementRevisions(@PathVariable String id, @RequestParam(required = false) String includeDeleted) {
UserSession session = getAuthenticatedSession(DEVELOPER);
boolean includeDeletedFlag = Boolean.valueOf(includeDeleted);
List<AppConfigElement> elements = service.getElementRevisions(session.getAppId(), id, includeDeletedFlag);
return new ResourceList<AppConfigElement>(elements).withRequestParam(INCLUDE_DELETED_PARAM, includeDeletedFlag);
}
use of org.sagebionetworks.bridge.models.accounts.UserSession in project BridgeServer2 by Sage-Bionetworks.
the class AppConfigElementsController method deleteElementAllRevisions.
@DeleteMapping("/v3/appconfigs/elements/{id}")
public StatusMessage deleteElementAllRevisions(@PathVariable String id, @RequestParam(required = false) String physical) {
UserSession session = getAuthenticatedSession(DEVELOPER);
if ("true".equals(physical) && session.isInRole(ADMIN)) {
service.deleteElementAllRevisionsPermanently(session.getAppId(), id);
} else {
service.deleteElementAllRevisions(session.getAppId(), id);
}
// App config elements are included in the app configs, so allow cache to update
cacheProvider.removeSetOfCacheKeys(CacheKey.appConfigList(session.getAppId()));
return new StatusMessage("App config element deleted.");
}
use of org.sagebionetworks.bridge.models.accounts.UserSession in project BridgeServer2 by Sage-Bionetworks.
the class AppController method verifySenderEmail.
@PostMapping(path = { "/v1/apps/self/verifyEmail", "/v3/studies/self/verifyEmail" })
public EmailVerificationStatusHolder verifySenderEmail() {
UserSession session = getAuthenticatedSession(DEVELOPER);
App app = appService.getApp(session.getAppId());
EmailVerificationStatus status = emailVerificationService.verifyEmailAddress(app.getSupportEmail());
return new EmailVerificationStatusHolder(status);
}
use of org.sagebionetworks.bridge.models.accounts.UserSession in project BridgeServer2 by Sage-Bionetworks.
the class AppController method resendVerifyEmail.
/**
* Resends the verification email for the current app's email.
*/
@PostMapping(path = { "/v1/apps/self/emails/resendVerify", "/v3/studies/self/emails/resendVerify" })
public StatusMessage resendVerifyEmail(@RequestParam(required = false) String type) {
UserSession session = getAuthenticatedSession(DEVELOPER);
AppEmailType parsedType = parseEmailType(type);
appService.sendVerifyEmail(session.getAppId(), parsedType);
return RESEND_EMAIL_MSG;
}
use of org.sagebionetworks.bridge.models.accounts.UserSession in project BridgeServer2 by Sage-Bionetworks.
the class AppController method getEmailStatus.
@GetMapping(path = { "/v1/apps/self/emailStatus", "/v3/studies/self/emailStatus" })
public EmailVerificationStatusHolder getEmailStatus() {
UserSession session = getAuthenticatedSession(DEVELOPER);
App app = appService.getApp(session.getAppId());
EmailVerificationStatus status = emailVerificationService.getEmailStatus(app.getSupportEmail());
return new EmailVerificationStatusHolder(status);
}
Aggregations