class UserNamespaceAuthorizationHelper {

    public Set<NamespaceAuthorization> getAllNamespaceAuthorizations()
    {
        Set<NamespaceAuthorization> namespaceAuthorizations = new LinkedHashSet<>();

        List<NamespaceKey> namespaceKeys = namespaceDao.getNamespaces();
        for (NamespaceKey namespaceKey : namespaceKeys)
        {
            NamespaceAuthorization namespaceAuthorization = new NamespaceAuthorization();
            namespaceAuthorizations.add(namespaceAuthorization);
            namespaceAuthorization.setNamespace(namespaceKey.getNamespaceCode());
            namespaceAuthorization.setNamespacePermissions(getAllNamespacePermissions());
        }

        return namespaceAuthorizations;
    }

}