Module: Card::Set::All::Permissions::Accounts

Included in:
Right::Account, Right::Email, Right::Password, Right::Salt, Right::Status, Right::Token
Defined in:
tmpsets/set/mod001-core/all/permissions.rb

Instance Method Summary collapse

Instance Method Details

#permit(action, verb = nil) ⇒ Object

This is a short-term hack that is used in account-related cards to allow a permissions pattern where permissions are restricted to the owner of the account (and, by default, Admin) That pattern should be permitted by our card representation (without creating separate rules for each account holder) but is not yet.



282
283
284
285
286
287
288
289
290
291
# File 'tmpsets/set/mod001-core/all/permissions.rb', line 282

def permit action, verb=nil
  if action == :comment then @action_ok = false
  elsif action == :create  then @superleft ? true : super(action, verb)
    # restricts account creation to subcard handling on permitted card
    # (unless explicitly permitted)
  elsif own_account? then true
  else
    super action, verb
  end
end