Package org.internna.iwebmvc.model.security

Examples of org.internna.iwebmvc.model.security.UserImpl


        l.getReadableText().add(Locale.UK, "b");
        l.setUrl("http://www.google.com");
        dao.create(l);
        generatedID = l.getId();
        securityDAO.createAuthority("registered_user");
        UserImpl john = new UserImpl();
        john.setUsername("john");
        john.setName("Jopn Smith");
        john.setPassword("john");
        john.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
        securityDAO.createUser(john);
        assertNotNull(securityDAO.findUser("john"));
        List<EntityParser<?>> parsers = new ArrayList();
        parsers.add(linkParser);
        impl.setParsers(parsers);
View Full Code Here


    @Before
    public void init() throws Exception {
        generatedDocIDs = new ArrayList<UUID>(5);
        logger.debug("Creating DB data for test");
        securityDAO.createAuthority("admin");
        UserImpl user = new UserImpl();
        user.setUsername("adminuser");
        user.setPassword("adminuser");
        user.setName("Admin");
        user.addRole((RoleImpl) securityDAO.findAuthority("admin"));
        securityDAO.createUser(user);
        assertNotNull(securityDAO.findUser("adminuser"));
        Document doc2 = new Document();
        doc2.setTemporal(true);
        doc2.setIdentifier("void image");
View Full Code Here

*/
public class AbstractOwnedDomainEntityTest {

    @Test
    public void testIsOwner() {
        UserImpl admin = new UserImpl();
        admin.setUsername("admin");
        AbstractOwnedDomainEntity entity = new AbstractOwnedDomainEntity() {
            @Override public String getCaption(Locale locale) {
                throw new UnsupportedOperationException("Not supported yet.");
            }
        };
        entity.addOwner(admin);
        assertTrue("Admin is owner of this entity", entity.isOwner(admin));
        UserImpl user = new UserImpl();
        user.setUsername("user");
        assertFalse("User is not owner of this entity", entity.isOwner(user));
    }
View Full Code Here

    @Autowired private DocumentParser documentParser;

    @Before
    public void init() throws Exception {
        securityDAO.createAuthority("admin");
        UserImpl user = new UserImpl();
        user.setUsername("iwebmvc");
        user.setName("IWebMvc");
        user.setPassword("iwebmvc");
        user.addRole((RoleImpl) securityDAO.findAuthority("admin"));
        securityDAO.createUser(user);
        Document doc = new Document();
        doc.setTemporal(false);
        doc.setIdentifier("void image");
        doc.setWidth(1);
View Full Code Here

    @Autowired private PollParser pollParser;

    @Before
    public void init() throws Exception {
        securityDAO.createAuthority("polladmin");
        UserImpl user = new UserImpl();
        user.setUsername("poller");
        user.setName("Poller");
        user.setPassword("poller");
        user.addRole((RoleImpl) securityDAO.findAuthority("polladmin"));
        securityDAO.createUser(user);
        Poll clubPoll = new Poll();
        clubPoll.setQuestion(new I18nText());
        clubPoll.getQuestion().add(new Locale("en"), "What's your favorite european football club?");
        clubPoll.getQuestion().add(new Locale("es"), "�Cual es tu equipo de futbol favorito de Europa?");
View Full Code Here

    @Before
    public void init() throws Exception {
        userManager.setName("john");
        securityDAO.createAuthority("registered_user");
        UserImpl john = new UserImpl();
        john.setUsername("john");
        john.setPassword("john");
        john.setName("John Smith");
        john.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
        securityDAO.createUser(john);
        assertNotNull(securityDAO.findUser("john"));
        UserImpl mary = new UserImpl();
        mary.setUsername("mary");
        mary.setPassword("mary");
        mary.setName("Mary Poppins");
        mary.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
        securityDAO.createUser(mary);
        assertNotNull(securityDAO.findUser("mary"));
        UserImpl viewer = new UserImpl();
        viewer.setUsername("viewer");
        viewer.setPassword("viewer");
        viewer.setName("viewer");
        viewer.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
        securityDAO.createUser(viewer);
        assertNotNull(securityDAO.findUser("viewer"));
        OwnedEntity one = new OwnedEntity();
        one.setName("one");
        dao.create(one);
View Full Code Here

    @Autowired protected ContextHolder holder;
    @Autowired protected AJAXValidator validator;

    @RequestMapping(method = RequestMethod.GET)
    public String showForm(@RequestParam(required = false, value = "username") String username, ModelMap model) {
        model.addAttribute("registereduser", new UserImpl());
        model.addAttribute("availableLocales", holder.getAvailableLocales());
        return "security/registration";
    }
View Full Code Here

    @Autowired protected SecurityDAO securityDao;
    @Autowired protected ContextHolder holder;

    @RequestMapping(method = RequestMethod.GET)
    public String showForm(@RequestParam(required = false, value = "username") String username, ModelMap model) {
        model.addAttribute("newuser", username == null ? new UserImpl() : securityDao.findUser(username));
        model.addAttribute("authorities", holder.getAuthorities());
        model.addAttribute("availableLocales", holder.getAvailableLocales());
        return "security/template";
    }
View Full Code Here

    }

    @RemoteMethod
    public boolean toggle(String username) throws Exception {
        Assert.hasText(username);
        UserImpl user = dao.findUser(username);
        user.toggle();
        dao.createUser(user);
        return user.isEnabled();
    }
View Full Code Here

    }

    @RemoteMethod
    public boolean update(Class clazz, UpdateDataDTO[] data) throws Exception {
        for (UpdateDataDTO dto : data) {
            UserImpl user = dao.findUser(dto.getPrimaryKey());
            BeanWrapper w = new BeanWrapperImpl(user);
            w.setPropertyValue(dto.getPath(), dto.getValue());
            dao.createUser(user);
        }
        return true;
View Full Code Here

TOP

Related Classes of org.internna.iwebmvc.model.security.UserImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.