Sha256: 3ba5f2aacfd458541b86cb4f89eef1c5f89ad4f2781b7915aaf8f36380388ef7
Contents?: true
Size: 569 Bytes
Versions: 12
Compression:
Stored size: 569 Bytes
Contents
class Ability include CanCan::Ability def initialize(user) alias_action :destroy, to: :delete @user = user if @user send(@user.user_role_type.code) else guest end end def guest end def default guest end def redactor default end def moderator default can :manage, Dashboard can [:read, :create], AdminComment can :destroy, AdminComment, user_id: @user.id cannot :destroy, User, id: @user.id end def admin can :manage, :all cannot :destroy, User, id: @user.id end end
Version data entries
12 entries across 12 versions & 1 rubygems