Displaying 4 results from an estimated 4 matches for "has_permission".
Did you mean:
ask_permission
2005 Dec 19
6
how to do security??
hey, i have maded some security in my website based on
http://www.chaconforcongress.com/accounts/login
Here they work with users, roles and persmission, and they check it like this,
user.has_permission(permission).
I have extended this to: users and groups with roles and permissions.
With permissions like "view records","edit records","delete records",...
def has_permission(permission)
@permissions = Hash.new(false)
for group in self.groups
for role in group.ro...
2005 Dec 22
0
conditions on model
hey,
this is the situation, an user may only access x clients (ex , 1, 5 ,6 ,7), so i
make a string with those ids and paste it to the sql statement, the user is from
the session
#creating a list of all the client record ids the user may access and paste it
in the sql statement
if user.has_permission(''admin'') || user.view_all == 1
text = ""
else
text = ""
first = true
# only list current user''s clients
for client in user.clients
if first == true
text += " and id IN ( " + client.id.to_s
first = false
else
text += "...
2006 Apr 17
3
model.models.models or model.models.find(:first).models
I the following three models which all have has_and_belongs_to_many
# User <-> UserGroup <-> Permissions
class UserGroup < ActiveRecord::Base
has_and_belongs_to_many :users, :join_table => "user_usergroup_join"
has_and_belongs_to_many :permissions, :join_table =>
"usergroup_permission_join", :uniq => true
end
I can do this:
permissions =
2009 Jan 09
14
undefined local variable or method `current_user' for
Hi All, I am using a Plugin mdarby-restful_acl with
restful_authentication and I am following the procedure form
http://github.com/mdarby/restful_acl/tree/master , but I am getting some
irritating error "undefined local variable or method `current_user'' for", I
know I am missing something but I dont know what?
Can anybody help me regarding this?
Shahroon