@Test public void testDeleteAccount() { boolean canDelete = userAccountHelper.canDeleteUser(person, "TEST"); assertFalse(canDelete); }
public void deleteAccount(IPerson currentUser, String target) { if (!canDeleteUser(currentUser, target)) { throw new RuntimeException( "Current user " + currentUser.getName() + " does not have permissions to update person " + target); } ILocalAccountPerson person = accountDao.getPerson(target); accountDao.deleteAccount(person); log.info("Account " + person.getName() + " successfully deleted"); }
UserAccountHelper { public void deleteAccount(IPerson currentUser, String target) { if (!canDeleteUser(currentUser, target)) { throw new RuntimeException( "Current user " + currentUser.getName() + " does not have permissions to update person " + target); } ILocalAccountPerson person = accountDao.getPerson(target); accountDao.deleteAccount(person); log.info("Account " + person.getName() + " successfully deleted"); } }
UserAccountHelper { public void deleteAccount(IPerson currentUser, String target) { if (!canDeleteUser(currentUser, target)) { throw new RuntimeException( "Current user " + currentUser.getName() + " does not have permissions to update person " + target); } ILocalAccountPerson person = accountDao.getPerson(target); accountDao.deleteAccount(person); log.info("Account " + person.getName() + " successfully deleted"); }  }
UserAccountHelper { public void deleteAccount(IPerson currentUser, String target) { if (!canDeleteUser(currentUser, target)) { throw new RuntimeException( "Current user " + currentUser.getName() + " does not have permissions to update person " + target); } ILocalAccountPerson person = accountDao.getPerson(target); accountDao.deleteAccount(person); log.info("Account " + person.getName() + " successfully deleted"); }  @Autowired void setLocaleStore(ILocaleStore localeStore); @Autowired void setLocaleManagerFactory(LocaleManagerFactory localeManagerFactory); @Autowired void setLocalAccountDao(ILocalAccountDao accountDao); @Autowired void setPortalPasswordService(IPortalPasswordService passwordService); @Resource(name = "accountEditAttributes") void setAccountEditAttributes(List<Preference> accountEditAttributes); @Autowired void setPortalUrlProvider(IPortalUrlProvider urlProvider); @Autowired void setMessageSource(MessageSource messageSource); @Autowired void setPersonManager(IPersonManager personManager); @Autowired void setGroupListHelper(IGroupListHelper groupListHelper); @Autowired void setPasswordResetNotification(IPasswordResetNotification passwordResetNotification); @Value("${org.apereo.portal.folder.login-layout:welcome}") void setLoginPortletFolderName(String loginPortletFolderName); PersonForm getNewAccountForm(); PersonForm getForm(String username); List<JsonEntityBean> getParentGroups(String target); boolean canEditUser(IPerson currentUser, String target); List<Preference> getEditableUserAttributes(IPerson currentUser); List<GroupedPersonAttribute> groupPersonAttributes(
            final IPersonAttributes user, final HttpServletRequest request); boolean canDeleteUser(IPerson currentUser, String target); void deleteAccount(IPerson currentUser, String target); void updateAccount(IPerson currentUser, PersonForm form); String getRandomToken(); boolean validateLoginToken(String username, String token); void sendLoginToken(HttpServletRequest request, ILocalAccountPerson account); void sendLoginToken(
            HttpServletRequest request,
            ILocalAccountPerson account,
            IPasswordResetNotification notification); void createPassword(PersonForm form, String token); }
UserAccountHelper { public void deleteAccount(IPerson currentUser, String target) { if (!canDeleteUser(currentUser, target)) { throw new RuntimeException( "Current user " + currentUser.getName() + " does not have permissions to update person " + target); } ILocalAccountPerson person = accountDao.getPerson(target); accountDao.deleteAccount(person); log.info("Account " + person.getName() + " successfully deleted"); }  @Autowired void setLocaleStore(ILocaleStore localeStore); @Autowired void setLocaleManagerFactory(LocaleManagerFactory localeManagerFactory); @Autowired void setLocalAccountDao(ILocalAccountDao accountDao); @Autowired void setPortalPasswordService(IPortalPasswordService passwordService); @Resource(name = "accountEditAttributes") void setAccountEditAttributes(List<Preference> accountEditAttributes); @Autowired void setPortalUrlProvider(IPortalUrlProvider urlProvider); @Autowired void setMessageSource(MessageSource messageSource); @Autowired void setPersonManager(IPersonManager personManager); @Autowired void setGroupListHelper(IGroupListHelper groupListHelper); @Autowired void setPasswordResetNotification(IPasswordResetNotification passwordResetNotification); @Value("${org.apereo.portal.folder.login-layout:welcome}") void setLoginPortletFolderName(String loginPortletFolderName); PersonForm getNewAccountForm(); PersonForm getForm(String username); List<JsonEntityBean> getParentGroups(String target); boolean canEditUser(IPerson currentUser, String target); List<Preference> getEditableUserAttributes(IPerson currentUser); List<GroupedPersonAttribute> groupPersonAttributes(
            final IPersonAttributes user, final HttpServletRequest request); boolean canDeleteUser(IPerson currentUser, String target); void deleteAccount(IPerson currentUser, String target); void updateAccount(IPerson currentUser, PersonForm form); String getRandomToken(); boolean validateLoginToken(String username, String token); void sendLoginToken(HttpServletRequest request, ILocalAccountPerson account); void sendLoginToken(
            HttpServletRequest request,
            ILocalAccountPerson account,
            IPasswordResetNotification notification); void createPassword(PersonForm form, String token);  }