public String getGeodeskId() { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerAuthorization) { return ((DeskmanagerAuthorization) authorization).getGeodeskId(); } } } return null; }
public Authentication getAuthentication(String authenticationToken) { Authentication auth = new Authentication(); auth.setAuthorizations(new BaseAuthorization[]{new LoginAuthorization()}); auth.setUserId("anynomous"); return auth; }
public void execute(LoginRequest request, LoginResponse response) throws Exception { String login = request.getLogin(); String password = request.getPassword(); if (null == login || null == password || "".equals(login) || "".equals(password)) { // need both user name and password to login return; } password = encode(PREFIX + login + password); if (password.endsWith(PADDING)) { password = password.substring(0, password.length() - 2); } for (UserInfo user : securityServiceInfo.getUsers()) { String userpw = user.getPassword(); if (null != userpw && userpw.endsWith(PADDING)) { userpw = userpw.substring(0, userpw.length() - 2); } if (login.equals(user.getUserId()) && password.equals(userpw)) { Authentication authentication = new Authentication(); authentication.setUserId(login); authentication.setUserName(user.getUserName()); authentication.setUserLocale(user.getUserLocale()); authentication.setUserOrganization(user.getUserOrganization()); authentication.setUserDivision(user.getUserDivision()); authentication.setAuthorizations(getAuthorizations(user)); response.setToken(tokenService.login(authentication)); } } }
public void execute(EmptyCommandRequest emptyCommandRequest, SuccessCommandResponse commandResponse) throws Exception { commandResponse.setSuccess(false); for (Authentication auth : securityContext.getSecurityServiceResults()) { if (SpringSecurityService.SECURITY_SERVICE_ID.equals(auth.getSecurityServiceId())) { tokenService.logout(securityContext.getToken()); commandResponse.setSuccess(true); } } } }
public Profile getProfile() { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerAuthorization) { return ((DeskmanagerAuthorization) authorization).getProfile(); } } } return null; }
public String getGeodeskId() { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerAuthorization) { return ((DeskmanagerAuthorization) authorization).getGeodeskId(); } } } return null; }
public boolean deleteAllowed(BaseGeodesk bp) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).deleteAllowed(bp); } } } return false; }
public boolean saveAllowed(LayerModel lm) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).saveAllowed(lm); } } } return false; }
public boolean readAllowed(BaseGeodesk bp) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).readAllowed(bp); } } } return false; }
public boolean readAllowed(Geodesk geodesk) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).readAllowed(geodesk); } } } return false; }
public boolean saveAllowed(LayerModel lm) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).saveAllowed(lm); } } } return false; }
public boolean isGeodeskUseAllowed(String geodeskId) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerGeodeskAuthorization) { return ((DeskmanagerGeodeskAuthorization) authorization).isGeodeskUseAllowed(geodeskId); } } } return false; }
public boolean deleteAllowed(Geodesk l) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).deleteAllowed(l); } } } return false; }
public Profile getProfile() { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerAuthorization) { return ((DeskmanagerAuthorization) authorization).getProfile(); } } } return null; }
public boolean readAllowed(BaseGeodesk bp) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).readAllowed(bp); } } } return false; }
public boolean saveAllowed(BaseGeodesk bp) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).saveAllowed(bp); } } } return false; }
public boolean isGeodeskUseAllowed(String geodeskId) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerGeodeskAuthorization) { return ((DeskmanagerGeodeskAuthorization) authorization).isGeodeskUseAllowed(geodeskId); } } } return false; }
public boolean saveAllowed(Geodesk l) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).saveAllowed(l); } } } return false; }
public boolean deleteAllowed(Geodesk l) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).deleteAllowed(l); } } } return false; }
public boolean deleteAllowed(LayerModel lm) { for (Authentication authentication : getSecurityServiceResults()) { for (BaseAuthorization authorization : authentication.getAuthorizations()) { if (authorization instanceof DeskmanagerManagementAuthorization) { return ((DeskmanagerManagementAuthorization) authorization).deleteAllowed(lm); } } } return false; }