Displaying 2 results from an estimated 2 matches for "is_moderator_of".
2006 Jul 11
0
Should I use exclamation marks for methods that change associations?
...', Group
a_model.accepts_role ''moderator'', user
a_model.accepts_no_role ''moderator'', user
Model.accepts_role ''class moderator'', user
With the new dynamic methods, we give the user-like model some flexibility:
user.is_moderator_of group --> sets user to have role "moderator"
for object group.
user.is_administrator --> sets user to have role
"administrator" not really tied to any object.
user.is_eligible_for award --> sets user to have role "eligible"
for object award.
In th...
2010 Jan 25
9
skinny Controllers, fat models with REST?
.../tasks.xml
def create
@authorized = false
@addsubtask=false
@task = Task.new(params[:task])
if(@task.parent_id != nil ) #wenn parent id nicht leer ist
ueberpruefe ob Rechte fuer Uebertask da sind
#if ( current_user.is_owner_of? Task.find(@task.parent_id) ) ||
( current_user.is_moderator_of? Task.find(@task.parent_id) )
if ( current_user.has_rights_for_task? Task.find
(@task.parent_id) , ["Owner","Moderator"])
@authorized = true #Rechte da
@addsubtask = true
else
@authorized = false #Rechte da
@addsubtask = true
end...