Module: Card::Set::All::Permissions::Follow

Included in:
Right::Follow
Defined in:
tmpsets/set/mod001-01_core/all/permissions.rb

Instance Method Summary collapse

Instance Method Details

#ok_to_createObject



278
279
280
# File 'tmpsets/set/mod001-01_core/all/permissions.rb', line 278

def ok_to_create
  permit :create
end

#ok_to_deleteObject



282
283
284
# File 'tmpsets/set/mod001-01_core/all/permissions.rb', line 282

def ok_to_delete
  permit :delete
end

#ok_to_updateObject



274
275
276
# File 'tmpsets/set/mod001-01_core/all/permissions.rb', line 274

def ok_to_update
  permit :update
end

#permit(action, verb = nil) ⇒ Object



286
287
288
289
290
291
292
293
# File 'tmpsets/set/mod001-01_core/all/permissions.rb', line 286

def permit action, verb=nil
  if [:create, :delete, :update].include?(action) && Auth.signed_in? &&
     (user = rule_user) && Auth.current_id == user.id
    return true
  else
    super action, verb
  end
end