Forum .LRN Q&A: Public Portals in dotLRN

Collapse
Posted by Roberto Mello on
I need help.

In our process of adapting dotLRN to work in an intranet environment, we bumped into the need of having a public portal for each department, besides the for-members-only portal which is created through the dotLRN communities.

Ideally those portals would have portlets just like the members-only portal (i.e. forums, news, weblogger, etc.)

Ben Bytheway found out that dotLRN communities already have a non-member portal. The next step then would be making specific objects (i.e. a forum instance) browseable in that portal.

The problem is that even if we give read permissions to dotlrn_user to that public portal, users can't get to it. They are stopped by the request processor because those users don't have read permission to the parent community (the non-member portal is rendered through portal procs and HTML is returned).

So if we give dotlrn_users read permission on the parent community, then everything in that community becomes available to all dotlrn_users through inheritance, which is not ideal (i.e. R&D, HR might have confidential documents).

We've thought of a number of approaches, the latest one being to create a "public" subcommunity for each department but I haven't found out how to give a certain group (i.e. dotlrn_users) read access to a community. I've found dotlrn_community::add_user_to_community, but it needs a user_id.

Thoughts? Ideas? Comments? Anything would be really welcome.

Thanks,

-Roberto

Collapse
Posted by Andrew Piskorski on
I may not fully understand, but if the problem is that the request processor is blocking access because the pages are within the package directory of non-publich package, then can't you just move the pages somewhere else, or hack the request processor to Do the Right Thing?
Collapse
Posted by Roberto Mello on
I can't just move the page (it's just one page) without complicating things and having to read a lot of new-portal and dotlrn code.

About hacking the request processor, that's one possibility. I was hoping somebody more knowledgeable in dotlrn code could give a better insight.

-Roberto

Collapse
Posted by Raad Al-Rawi on

Hi Roberto

This was one of the first things we realised when we started looking at dotLRN - our solution (which is not ideal, but works part way) was to develop an auto-registration + membership facility, which can be linked to email patterns.

Basically it works like this - I added 3 parameters for the Main Site:

  • AutoAddTodotLRN [0 or 1] (Automatically add users to a default dotLRN community?)
  • AutoAddUseEmailPattern [0 or 1] (If AutoAddTodotLRN, then only emails matching dotLRN email pattern are AutoAdded)
  • AutoAdddotLRNCommunityID [int] (If AutoAddTodotLRN, the ID of the dotLRN community that people who register will automatically join)

and hooked into the email patterns stuff already in dotLRN. I also amended the registration pages a bit, to do the checking and dotLRN membership bit.

I then created a community called the Open Community, and used it's community_id to set AutoAdddotLRNCommunityID.

So once I turned AutoAddTodotLRN on, I could have everyone who registered with the site automatically added to the Open Community, and I could restrict this by using email patterns if I didn't want everyone who registered to join automatically.

As I mentioned, it's not the same as having a public area (as it requires the user to register), but it's someway there.

Another possible solution, that ocurred to me as I write this, is to create a community (like my Open Community) to act as the public area, create a user (say, Guest, or Anonymous) who is a limited guest user (although if they are guest, they can't see forums, so you might want to hack that!) and hack the login to default to that user if no login data is entered. Again, not ideal, but a bit closer to the ideal maybe??

Just my quasi-random thoughts on the problem :)

<Raad>

Collapse
Posted by Raad Al-Rawi on
Of course, having re-read your problem, my post doesn't actually solve it :p

I'll mull it over some more...

R
Collapse
Posted by Caroline Meeks on
Hi Roberto,

I  know exactly what your problem is, I don't have a solution but I can tell you the history of it and maybe that will help us get to a solution.

When dotLRN was delivered to Sloan last year I did a lot of bug fixing to get it ready for launch. One of the bugs was there was no membership check on any page that displayed community content except the portal. So if someone url hacked, or  if one user forwarded another a notification with urls linking directly to say a page in forums, that user was able to see the forum message even if they were not a member of that community.

Obviously this was unacceptable, and the obvious solution seemed to be to require community membership to read a class or any package mounted under it.

This fix lead to one immediate problem.  You could no longer use the register page of the community you wanted to join, because since you  weren't a member yet, you couldn't view it.  The simple fix to that was to pass the community_id to the register page of dotLRN package you were currently in rather then the one you wanted to join.

The second problem  I didn't find for 6 months when I tried to create public portals and found the same code Ben Bytheway found and ran into the same problem you did.  I don't see how the public portals can work with the permission set up currently on dotLRN.

One  thing you should be aware of is that the public portal code has never been used so even without the permissions settings it may not work.  You should coordinate with the people contemplating a portals rewrite and see if they are even planning on keeping it.

It's possible that an analogous solution to the register page might work. You might be able to set up the dotLRN pages to take a portal_id and then use the dotLRN package one level up to display the community's public portal.

I didn't try this because the problem I was trying to solve for Sloan was slightly different then what you are trying to do.  I wanted to replace the uninformative Security Violation page at any url within a community with a page customized for each community that gave a link to join that community if the user had permission to join (i.e. the community is open and the user is a full access user).  Thus if someone is following a link from a forwarded notification to a forum message of a community they are not a member of a useful and informative page is displayed.  I never found a way to do that without hacking the request processor and it was a "nice-to-have" feature not a requirement so it was never implemented.

Collapse
Posted by Roberto Mello on
Raad,

Thanks for the insight. No matter if it doesn't directly solve my problem, but I appreciate the input and your time. I'd like to keep this flow of ideas coming, so whatever you come up with, please let us know.

Thanks,

-Roberto

Collapse
Posted by Roberto Mello on
Caroline,

Thanks a lot for posting this history and your thoughts. Please let's keep this flow of ideas coming through.

Re: Public portals, they have worked fine in our tests, but I haven't found the usual UI for editing the portal and adding new portlets. We've added portlets to it via Tcl or PL/pgSQL. The problem is as you describe: we had to give dotlrn_user read permissions on the whole community for a non-member to be able to view the non-member portal. But as a consequence s/he could see everything else in the community, which is not what we want.

I like your idea of passing the community_id up to be displayed by the portal of the community the user belongs to. I'll explore that.

Hmm, the feature you were trying to get working would be a really nice one to have indeed. Perhaps it can come out as a by-product of this discussion.

Thanks again.

-Roberto

Collapse
Posted by Benjamin Bytheway on
Just a quick update on our progress:

Today, I attempted to make the public portal available through a page that the user has permission to access, by passing in the community_id, per Caroline's suggestion.  While I did manage to get the portal to show up, there were problems that I should have anticipated that makes this approach (alone) insufficient.

While the different portlets that are in the non-member portal do display just fine (including the community's public file storage folder), there is no way to get past the portal page to do anything useful.  For example, clicking on a file in the public file storage folder to attempt a download will result in a security violation page.  I should have realized that while the public has read privileges on the individual file object, they aren't allowed to communicate with the parent package that manages it.  This permissions scheme will prevent this approach from working without some further (and I'm guessing serious) hacking.

I'm starting to feel like we're trying to put a square peg into a round hole.  It might be time to just drill another hole and do public page outside the dotlrn framework. I do still hope we can find a solution that isn't that drastic.

Comments? Suggestions?  We're eagerly listening.

Ben

Collapse
Posted by xx xx on
.LRN is very user-centric, so it seems you'll have to mess with the user-id.

If you want to use the non-member portals, which is probably the way to go, you may look into adding a default-dotlrn-user with appropriate permissions and than redirect non-registered visitors and non-dotlrn-user using this default-dotlrn-user_id.

What happens if you add object_id 0 as a dotlrn_user (remember https://openacs.org/forums/message-view?message_id=107004)?

Collapse
Posted by xx xx on
It may be obvious, but some community information is protected by the 'read_private_data' permission. So guest can't read this information (for US legal reasons). Depending on what you want to achieve, you'll have to work around that too.
Collapse
Posted by Lars Pind on
We actually hacked something up along these lines as a demo for Copenhagen University.

We looked at the public portal, but decided against using it, because it would require the group admin to maintain two portals. Whenever he adds a portlet or rearranges things, he'd have to do the same add/rearrange to the non-member portal.

Instead, what we did was make some changes to the permission structure, so that portlets actually check permissions on the relevant packages before displaying themselves. That way, you'll only see what you're allowed to see.

Here are a few links for you to try it out:

If you simply visit

http://nik.collaboraid.net

you'll see a list of publicly accessible courses.

You can browse those (currently 'that') course, and see whatever the admin has allowed you to see.

Then if you login with the 'admin' link from this page:

http://nik.collaboraid.net/register/

you can visit:

http://nik.collaboraid.net/dotlrn/classes/computerscience/computerandnetworksecurity/computerandnetworksecurityfall20032004/public-access

(also linked off of the class admin page), where you can define the public access of the group with the checkboxes and the 'make public' and 'make private' buttons.

Try it out.

The code can be downloaded here:

http://www.collaboraid.biz/developer/nik-packages.tgz

It hasn't been committed because it's a hack. It's a hack because we had zero time to do it, and because .LRN permissions are a hack in the first place.

But please do take a look, and if someone has the time and courage to clean it up and commit it (the tarball also contains a number of other interesting new features, such as easy access to archived courses, anonymous forums postings, etc.), then please go ahead.

/Lars

Collapse
Posted by xx xx on
Nice!
Hmmm, I wish I could do that in zero time ! And you call it a 'Hack' ...

Do you feel this will make the 'non-member portal' obsolete? Or are you planning to?
Am I correct that permissions can be set for each forum in a portlet but for calendar we would need a public and non public portlet?

Thanks.

Collapse
Posted by Lars Pind on
Aldert,

Re non-member portal ... As I mentioned, the problem is that the administrator has to maintain both portals in order for it to make sense.

Ideally, I'd like that choice to be up to the course admin, so he/she can choose which users get to see which portal, based on group memberships or permissions.

However, that's more work. So as it stands, I think it makes more sense to forget about the non-member portal for now.

I haven't thought about the calendar. Currently there's only the community calendar and a personal calendar. Are you thinking that there'd be a third non-member community calendar?

What would that be used for?

/Lars

Collapse
Posted by xx xx on
I think a Public/Non-public calendar separation is useful in most cases.

For example, a drama-class will have non-public rehearsals and public performances, a school/company will have non-public meetings and public festivities, etcetera.

It would be nice if every calendar_item could be set either Public or Non_public, unless it is easier (or more secure) to have a Public Calendar and a Community Calendar apart.

Collapse
Posted by Malte Sussdorff on
Has anyone actually succeeded in putting this into .LRN so a non registered user (read: The Public) can access a file in the file-storage of a community?