Sha256: 357836766d135e91cb78d93e1b58c00afc340c561e20d76a54fe68b917d3f3ed
Contents?: true
Size: 787 Bytes
Versions: 31
Compression:
Stored size: 787 Bytes
Contents
module Ddr::Auth RSpec.describe EffectivePermissions do let(:resource) { FactoryGirl.build(:item) } let(:policy) { Collection.new(id: "coll-1") } let(:agents) { [ "Editors", "bob@example.com" ] } before do resource.admin_policy = policy resource.roles.grant FactoryGirl.build(:role, :downloader, :public) policy.roles.grant role_type: "Editor", agent: "Editors", scope: "policy" end it "should return the list of permissions granted to the agents on the resource in resource scope, plus the permissions granted to the agents on the resource's policy in policy scope" do expect(described_class.call(resource, agents)) .to contain_exactly(:read, :download, :add_children, :update, :replace, :arrange) end end end
Version data entries
31 entries across 31 versions & 1 rubygems