Package org.zanata.model

Examples of org.zanata.model.HAccount


        assertThat(translatorList.get(editorClientId).getPerson().getName(),
                Matchers.equalTo("pahuang"));
    }

    private static HAccount createHAccount(String email, String name) {
        HAccount hAccount = new HAccount();
        HPerson hPerson = new HPerson();
        hPerson.setEmail(email);
        hPerson.setName(name);
        hAccount.setPerson(hPerson);
        return hAccount;
    }
View Full Code Here


    public void release(Lock l) {
        locks.remove(l);
    }

    private String getCurrentUser() {
        HAccount user =
                ServiceLocator.instance().getInstance(
                        JpaIdentityStore.AUTHENTICATED_USER, HAccount.class);
        String newLocker = user != null ? user.getUsername() : "unknown";
        return newLocker;
    }
View Full Code Here

                // apply the rule
                account.getRoles().add(rule.getRoleToAssign());
            }
        }

        HAccount persistedAcc = accountDAO.makePersistent(account);
        accountDAO.flush();
        return persistedAcc;
    }
View Full Code Here

                identityStore.createUser(username, null);
                identityStore.disableUser(username);
            }
        }.addRole("admin").run();

        HAccount account = accountDAO.getByUsername(username);
        HPerson person = new HPerson();
        person.setAccount(account);
        person.setEmail(email);
        person.setName(name);
View Full Code Here

                identityStore.createUser(username, password);
                identityStore.disableUser(username);
            }
        }.addRole("admin").run();

        HAccount account = accountDAO.getByUsername(username);
        HPerson person = new HPerson();
        person.setAccount(account);
        person.setEmail(email);
        person.setName(name);
View Full Code Here

                                                          // initially
                identityStore.disableUser(username);
            }
        }.addRole("admin").run();

        HAccount account = accountDAO.getByUsername(username);
        account.getCredentials().add(
                new HOpenIdCredentials(account, externalId, email));
        HPerson person = new HPerson();
        person.setAccount(account);
        person.setEmail(email);
        person.setName(name);
View Full Code Here

    }

    @Test
    public void injectActionAndAllow() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("action-should-grant", new HAccount()))
                .isTrue();
    }
View Full Code Here

    }

    @Test
    public void injectActionAndDeny() throws Exception {
        assertThat(complexPermissionEvaluator
                .checkPermission("action-should-deny", new HAccount()))
                .isFalse();
    }
View Full Code Here

    @BeforeMethod
    public void setUp() {
        MockitoAnnotations.initMocks(this);
        deleteAllTables();
        HAccount authenticatedUser =
                EntityMakerBuilder.builder().includeOptionalOneToOne().build()
                        .makeAndPersist(getEm(), HAccount.class);
        service = seam.reset()
                .use("entityManager", getEm())
                .use("session", getSession())
View Full Code Here

    private static HTextFlowTarget addHTextFlowTarget(HLocale hLocale,
            HTextFlow hTextFlow, String username) {
        HTextFlowTarget hTextFlowTarget =
                new HTextFlowTarget(hTextFlow, hLocale);
        HPerson lastModifiedBy = new HPerson();
        HAccount account = new HAccount();
        account.setUsername(username);
        lastModifiedBy.setAccount(account);
        hTextFlowTarget.setLastModifiedBy(lastModifiedBy);
        hTextFlowTarget.setLastChanged(new Date());
        return hTextFlowTarget;
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HAccount

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.