• R/O
  • HTTP
  • SSH
  • HTTPS

Tags
No Tags

Frequently used words (click to add to your profile)

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

File Info

Rev. a12872389fb61f52bf95cdc2b68ad112483674b3
크기 509 bytes
Time 2021-03-19 12:24:33
Author HMML
Log Message

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