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

Included in:
Right::Account, Right::Email, Right::Password, Right::Salt, Right::Status, Right::Token
Defined in:
tmpsets/set/mod003-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.



270
271
272
273
274
275
276
277
278
# File 'tmpsets/set/mod003-core/all/permissions.rb', line 270

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