Thanks. Your plugin looks really interesting.
What I am currently trying to do is check if a role has
Create/Read/Update/Delete rights on a post. This should be stored in the
database too. So, in my case there’d also be a posts_roles table. I
implemented anything yet (besides giving users one or more roles).
Like I said, I don’t want to hardcode the rights for a role. Instead I
to lookup the roles’ rights for a post in the database. Does/will your
provide for something like this?
“Ezra Z.” firstname.lastname@example.org wrote in
You might want to look at my acl_system plugin. It handles role
like you want in a more secure way.
class PostController < ApplicationController
before_filter :login_required, :except => [:list, :index]
access_control [:new, :create, :update, :edit] => ‘(admin | user |
:delete => ‘admin & (!moderator & !blacklist)’
On Feb 23, 2006, at 11:43 AM, Mischa B. wrote:
Sorry for reposting, but my date was set 1-feb today (don’t ask) and I’m
sure if this gets read…
My question is about this method:
Returns true for the (saved) user called “admin”
true if save and name == “admin”
The method returns true if the user’s name is admin. However, I only
return true if the state of the object is “saved”, so I call the save
I’m doing this because…
Once the admin is created I don’t want anyone to be able to change the
I implemented this like this in the view:
<% if @user and @user.is_the_administrator %>
<%= text_field “user”, “name”, :disabled => true %>
<% else %>
<%= text_field “user”, “name” %>
<% end %>
However when someone else tries to change their name to “admin”, the
text_field will be disabled too. The object is not saved, because of the
validation (validates_uniqueness_of :name). So I only want the field to
disabled if the object is saved. The way I implemented it now works, but
guessing there’s a better way to do this.
Rails mailing list
Rails mailing list