Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove display cancan alias (3.6-stable) #1318

Merged
merged 2 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lib/alchemy/permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module GuestUser
def alchemy_guest_user_rules
can([:show, :download], Alchemy::Attachment) { |a| !a.restricted? }
can :see, Alchemy::Page, restricted: false, visible: true
can(:display, Alchemy::Picture) { |p| !p.restricted? }

can :read, Alchemy::Content, Alchemy::Content.available.not_restricted do |c|
c.public? && !c.restricted? && !c.trashed?
Expand Down Expand Up @@ -65,7 +64,6 @@ def alchemy_member_rules
can [:show, :download], Alchemy::Attachment
can :read, Alchemy::Page, Alchemy::Page.published, &:public?
can :see, Alchemy::Page, restricted: true, visible: true
can :display, Alchemy::Picture

can :read, Alchemy::Content, Alchemy::Content.available do |c|
c.public? && !c.trashed?
Expand Down Expand Up @@ -215,11 +213,6 @@ def set_action_aliases
:unlock,
:visit,
to: :edit_content

alias_action :show,
:thumbnail,
:zoom,
to: :display
end

# Include the role specific permissions.
Expand Down
22 changes: 0 additions & 22 deletions spec/libraries/permissions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
is_expected.not_to be_able_to(:show, restricted_attachment)
end

it "can only see not restricted pictures" do
is_expected.to be_able_to(:show, picture)
is_expected.to be_able_to(:thumbnail, picture)
is_expected.to be_able_to(:zoom, picture)
is_expected.not_to be_able_to(:show, restricted_picture)
is_expected.not_to be_able_to(:thumbnail, restricted_picture)
is_expected.not_to be_able_to(:zoom, restricted_picture)
end

it "can only visit not restricted pages" do
is_expected.to be_able_to(:show, public_page)
is_expected.not_to be_able_to(:show, restricted_page)
Expand Down Expand Up @@ -82,15 +73,6 @@
is_expected.to be_able_to(:show, restricted_attachment)
end

it "can see all pictures" do
is_expected.to be_able_to(:show, picture)
is_expected.to be_able_to(:thumbnail, picture)
is_expected.to be_able_to(:zoom, picture)
is_expected.to be_able_to(:show, restricted_picture)
is_expected.to be_able_to(:thumbnail, restricted_picture)
is_expected.to be_able_to(:zoom, restricted_picture)
end

it "can visit restricted pages" do
is_expected.to be_able_to(:show, public_page)
is_expected.to be_able_to(:show, restricted_page)
Expand Down Expand Up @@ -134,10 +116,6 @@
is_expected.to be_able_to(:info, :alchemy_admin_dashboard)
end

it "can see picture thumbnails" do
is_expected.to be_able_to(:thumbnail, Alchemy::Picture)
end

it "can edit page content" do
is_expected.to be_able_to(:show, unpublic_page)
is_expected.to be_able_to(:index, Alchemy::Page)
Expand Down