Module: Alchemy::Permissions::AuthorUser

Includes:
MemberUser
Included in:
Alchemy::Permissions, EditorUser
Defined in:
lib/alchemy/permissions.rb

Overview

Author rules

Includes member users rules

Instance Method Summary collapse

Methods included from MemberUser

#alchemy_member_rules

Methods included from GuestUser

#alchemy_guest_user_rules

Instance Method Details

#alchemy_author_rulesObject



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/alchemy/permissions.rb', line 80

def alchemy_author_rules
  alchemy_member_rules

  # Navigation
  can :index, [
    :alchemy_admin_attachments,
    :alchemy_admin_dashboard,
    :alchemy_admin_layoutpages,
    :alchemy_admin_nodes,
    :alchemy_admin_pages,
    :alchemy_admin_pictures,
    :alchemy_admin_tags,
    :alchemy_admin_users
  ]

  # Controller actions
  can :leave, :alchemy_admin
  can [:info, :help], :alchemy_admin_dashboard
  can :manage, :alchemy_admin_clipboard
  can :edit, :alchemy_admin_layoutpages
  can :tree, :alchemy_admin_pages

  # Resources
  can [:read, :download], Alchemy::Attachment
  can :manage, Alchemy::Element
  can :manage, Alchemy::Ingredient
  can [:crop], Alchemy::Ingredients::Picture
  can :manage, Alchemy::LegacyPageUrl
  can :manage, Alchemy::Node
  can [:read, :url], Alchemy::Picture
  can [:read, :autocomplete], Alchemy::Tag
  can :edit_content, Alchemy::Page, Alchemy::Page.all do |page|
    page.editable_by?(@user)
  end
end