Commit aaa3c51e by Tuukka Kivilahti

permfixei

1 parent 6b823228
...@@ -369,11 +369,8 @@ public class EventBean implements EventBeanLocal { ...@@ -369,11 +369,8 @@ public class EventBean implements EventBeanLocal {
} }
@Override @Override
@RolesAllowed(SpecialPermission.S_SUPERADMIN)
public List<LanEvent> findFutureEvents() { public List<LanEvent> findFutureEvents() {
if(!permbean.getCurrentUser().isSuperadmin()) {
throw new EJBAccessException("Must be superadmin to see all events, sorry");
}
return eventFacade.findFutureEvents(); return eventFacade.findFutureEvents();
} }
......
...@@ -95,6 +95,7 @@ import fi.codecrew.moya.utilities.PasswordFunctions; ...@@ -95,6 +95,7 @@ import fi.codecrew.moya.utilities.PasswordFunctions;
import fi.codecrew.moya.utilities.SearchQuery; import fi.codecrew.moya.utilities.SearchQuery;
import fi.codecrew.moya.utilities.SearchResult; import fi.codecrew.moya.utilities.SearchResult;
import fi.codecrew.moya.utilities.moyamessage.MoyaEventType; import fi.codecrew.moya.utilities.moyamessage.MoyaEventType;
import scala.tools.cmd.Spec;
@LocalBean @LocalBean
@Stateless @Stateless
...@@ -1129,11 +1130,8 @@ public class UserBean implements UserBeanLocal { ...@@ -1129,11 +1130,8 @@ public class UserBean implements UserBeanLocal {
} }
@Override @Override
@RolesAllowed(SpecialPermission.S_SUPERADMIN)
public List<User> findSuperusers() { public List<User> findSuperusers() {
if(!permbean.getCurrentUser().isSuperadmin())
throw new EJBException("Only superadmin can see other superadmins, sorry!");
return userFacade.findSuperusers(); return userFacade.findSuperusers();
} }
......
...@@ -312,6 +312,10 @@ public class EventOrgView extends GenericCDIView { ...@@ -312,6 +312,10 @@ public class EventOrgView extends GenericCDIView {
} }
public List<User> getSuperUsers() { public List<User> getSuperUsers() {
if(!permbean.getCurrentUser().isSuperadmin())
return new ArrayList<User>();
return userBean.findSuperusers(); return userBean.findSuperusers();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!