El Dorado

A full-stack community web application written in Ruby/Rails
"Private" forums « El Dorado « almost effortless
 
Mon, 19 May 2008, 10:38am #1
irkenInvader
Member
Zim
Registered: May, 2008
Last visit: Wed, 04 Jun 2008
Posts: 85

Is there a way to make the forums not as "private" as the private option is now?

In other words, make the posts/forums/events/etc. viewable by anyone, but only allow "new" or "modify" actions to be performed by users who log in?


Zim wrote:

Invader’s blood marches through my veins like giant, radioactive rubber pants! The pants command me! Do not ignore my veins!

Offline
Mon, 19 May 2008, 10:44am #2
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 7 hours ago
Posts: 226

You could modify the "check_privacy" filter to accomplish something like that. If you make an option for this kind of thing, let me know. That's something with might be nice to have in the core app. I've been intentionally avoiding complex permissions stuff because it's so difficult to meet a lot of use cases - so I thought I'd just start out with two options for the whole site: public and private.

Offline
Mon, 19 May 2008, 4:56pm #3
Elk
New member
Registered: May, 2008
Last visit: Sat, 31 May 2008
Posts: 4

Are the 'new' and 'modify' settings not already only available to users that have logged in?

I know that in my case i needed to make the forums viewable by everyone but only editable by users that were in the 'club' so i just moved the link to register a new user to the admin section and that works for me as a quick hack for now anyway.

Offline
Mon, 19 May 2008, 5:06pm #4
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 7 hours ago
Posts: 226

I'm sorry - I must have read then a little too early in the morning. That's right - new and modify actions are only available to logged in users.

Offline
Tue, 20 May 2008, 9:38am #5
irkenInvader
Member
Zim
Registered: May, 2008
Last visit: Wed, 04 Jun 2008
Posts: 85

Thanks Elk,

A "quick Hack" was exactly what I was looking for!


Zim wrote:

Invader’s blood marches through my veins like giant, radioactive rubber pants! The pants command me! Do not ignore my veins!

Offline
Tue, 20 May 2008, 10:01am #6
irkenInvader
Member
Zim
Registered: May, 2008
Last visit: Wed, 04 Jun 2008
Posts: 85

Elk, a quick question

Unfortunately, moving the link to register new user to only appear on the admin page does not prevent people from typing the following into their browser's address bar:

http://www.example.com/users/new

Which will load the "Register" page and allow them to complete the form.

Did you manage this at all?


Zim wrote:

Invader’s blood marches through my veins like giant, radioactive rubber pants! The pants command me! Do not ignore my veins!

Offline
Tue, 20 May 2008, 10:06am #7
irkenInvader
Member
Zim
Registered: May, 2008
Last visit: Wed, 04 Jun 2008
Posts: 85

I changed the following line in app/controllers/users_controller.rb to fix the problem:

Original:

before_filter :require_admin, :only => [:admin, :ban, :remove_ban]

New:

before_filter :require_admin, :only => [:admin, :ban, :remove_ban, :new]

Seems to be working for me.


Zim wrote:

Invader’s blood marches through my veins like giant, radioactive rubber pants! The pants command me! Do not ignore my veins!

Offline
Tue, 20 May 2008, 10:14am #8
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 7 hours ago
Posts: 226

You should also add :create to that list - otherwise someone could submit the form directly to the create action and make the user that way.

Offline
Tue, 20 May 2008, 10:37am #9
irkenInvader
Member
Zim
Registered: May, 2008
Last visit: Wed, 04 Jun 2008
Posts: 85

awesome, thanks


Zim wrote:

Invader’s blood marches through my veins like giant, radioactive rubber pants! The pants command me! Do not ignore my veins!

Offline
Tue, 20 May 2008, 3:44pm #10
Elk
New member
Registered: May, 2008
Last visit: Sat, 31 May 2008
Posts: 4

Hi, sorry I didnt go into detail in the first post, wasnt sure if that was what you were looking for, but yeah i made those changes to the before_filter with both :new & :create.

And actually you dont even need to move it into the admin section really, would just work with an if admin? check on the setup just now, but it feels a little bit better to have it there in the admin section :)

Offline