Best approach to providing app congurations?

This is more about theory than coding so I hope I have the right place.
I would very much appreciate some input as to the best approach on how
to offer different options in my app depending on configuration criteria
and current user.

Some examples of what I want to do I guess would be a help.

Firstly I have an administration control panel that administrators can
log into and do the usual stuff that admins do :slight_smile:
The site may have different configration switches that determine what
options are available in the administration panel.
For example the site may be configured to have blogs enabled.
Obviously if blogs are not enabled then there should be no
administration options to maintain blogs other than to enable them.
I though I might use a site_configuration table to determine what site
“add on’s” are available and what are enabled.

A user can have different levels of access.
Some user roles will not have access to the administration panel at all.
For example users that are logged in as members i.e. users with a role
of member will not be able to log in as administrators but will be able
to view their own profile and will be able to access areas of the site
that non logged in users can’t see.

I’m using a user_roles table to record a users role where a user can
have many roles therefore allowing for a user to be both an
administrator and a member.

That just about covers the requirement although there are more roles and
more functionality than mentioned.

So the question comes down to how best to achieve site configuration
options and also user access options.

Current thoughts are that I could provide the site configurations as
some kind of plug in or possibly a better solution might be to have
specific menu options that only visible according to the state of the
current user and the site configuration settings.

One concern I have is that I don’t want to clutter up the views with too
much conditional logic for options that may never even exist for that
particular site.

I have implemented my own authoridsation process based around AWDWR’s
authentication solution but I was wondering if authlogic may be asble to
provide a better answer to the user role scenarios?

Hope that makes sense and any input as to best approach would be greatly
appreciated.

p.s. target language is Rails 2.3.23 but will be moving on to 2.3.4
ASAP.

James W. wrote:

options are available in the administration panel.
to view their own profile and will be able to access areas of the site
options and also user access options.
I have implemented my own authoridsation process based around AWDWR’s
authentication solution but I was wondering if authlogic may be asble to
provide a better answer to the user role scenarios?

Hope that makes sense and any input as to best approach would be greatly
appreciated.

p.s. target language is Rails 2.3.23 but will be moving on to 2.3.4
ASAP.

I have no idea if this is the best method by any means, but I have used
it before with no problems:

I created a model called AppConfig which had an id, a key and a value. I
could set the key to the name of the configuration (such as
“allow_new_signups”) and then set the value as required.

Then all I needed to do was AppConfig.find_by_key(“allow_new_signups”)
and I have my configurations back.

As I say, there are possibly much better ways to do this, but it worked
fine for my needs. YMMV.

Hope this helps.

Matt

Matt H. wrote:

I have no idea if this is the best method by any means, but I have used
it before with no problems:

I created a model called AppConfig which had an id, a key and a value. I
could set the key to the name of the configuration (such as
“allow_new_signups”) and then set the value as required.

Then all I needed to do was AppConfig.find_by_key(“allow_new_signups”)
and I have my configurations back.

As I say, there are possibly much better ways to do this, but it worked
fine for my needs. YMMV.

Hope this helps.

Matt

Thankyou Matt.
I would like to explore that option further. I think it has potential
:slight_smile:
Very much appreciated the input

James