• R/O
  • HTTP
  • SSH
  • HTTPS

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

Révision a12872389fb61f52bf95cdc2b68ad112483674b3
Taille 509 octets
l'heure 2021-03-19 12:24:33
Auteur HMML
Message de Log

Add 36126 amedas station file for backword compatibility.

Content

class Ability
  include CanCan::Ability

  def initialize(user)
    if user && user.is_admin?
      can :manage, :all
      return
    end

    # allows WITHOUT login
    can %i(show), User
    can %i(index new create), Theme
    can %i(show orig archive), Theme, disabled: false
    can %i(index show edit update new create), Draft

    return unless user

    # allows for logged-in users
    can %i(edit update destroy), User, id: user.id
    can %i(edit update destroy), Theme, user_id: user.id
  end
end