- if (!CmsSession.hasCmsSession(CurrentSubject.current())) {
- if (DataAdminPrincipal.isDataAdmin(CurrentSubject.current())) {
+ Subject subject = CurrentSubject.current();
+ if (subject == null)
+ throw new IllegalStateException("Caller must be authenticated");
+ if (!CmsSession.hasCmsSession(subject)) {
+ if (DataAdminPrincipal.isDataAdmin(subject)) {