@Override protected void onConfigure() { super.onConfigure(); setEnabled(isProfileSelfServiceAllowed()); }
@Override protected void onConfigure() { super.onConfigure(); setEnabled(isProfileSelfServiceAllowed()); }
public ManageUsersPage() { super(); commonInit(); // If the user is not an admin, then pre-load the current user to allow self-service // editing of the profile if (!isAdmin() && SecurityUtil.isProfileSelfServiceAllowed()) { selectedUser.setObject(userRepository.getCurrentUser()); } }
public ManageUsersPage() { super(); commonInit(); // If the user is not an admin, then pre-load the current user to allow self-service // editing of the profile if (!isAdmin() && SecurityUtil.isProfileSelfServiceAllowed()) { selectedUser.setObject(userRepository.getCurrentUser()); } }
public ManageUsersPage(final PageParameters aPageParameters) { super(aPageParameters); commonInit(); String username = aPageParameters.get(PARAM_USER).toOptionalString(); User user = null; if (username != null) { user = userRepository.get(username); } if (user != null) { if (isAdmin()) { selectedUser.setObject(user); } else if (SecurityUtil.isProfileSelfServiceAllowed() && userRepository.getCurrentUser().getUsername().equals(user.getUsername())) { selectedUser.setObject(userRepository.getCurrentUser()); } else { // Make sure a user doesn't try to access the profile of another user via the // parameter if self-service is turned on. setResponsePage(getApplication().getHomePage()); } } }
public ManageUsersPage(final PageParameters aPageParameters) { super(aPageParameters); commonInit(); String username = aPageParameters.get(PARAM_USER).toOptionalString(); User user = null; if (username != null) { user = userRepository.get(username); } if (user != null) { if (isAdmin()) { selectedUser.setObject(user); } else if (SecurityUtil.isProfileSelfServiceAllowed() && userRepository.getCurrentUser().getUsername().equals(user.getUsername())) { selectedUser.setObject(userRepository.getCurrentUser()); } else { // Make sure a user doesn't try to access the profile of another user via the // parameter if self-service is turned on. setResponsePage(getApplication().getHomePage()); } } }
private void commonInit() if (!isAdmin() && !SecurityUtil.isProfileSelfServiceAllowed()) { setResponsePage(getApplication().getHomePage());
private void commonInit() if (!isAdmin() && !SecurityUtil.isProfileSelfServiceAllowed()) { setResponsePage(getApplication().getHomePage());