Sha256: 712ee07ae6a4b9532032684249a0b5c4edef1e06dee20403f842e7f39a42a4d9
Contents?: true
Size: 839 Bytes
Versions: 78
Compression:
Stored size: 839 Bytes
Contents
module Ddr::Auth RSpec.describe EffectiveRoles do let(:resource) { FactoryGirl.build(:item) } let(:policy) { Collection.new(pid: "coll:1") } let(:agents) { [ "Editors", "bob@example.com", "public" ] } let(:editor) { Roles::Role.build type: "Editor", agent: "Editors", scope: "policy" } let(:downloader) { FactoryGirl.build(:role, :downloader, :public) } before do resource.admin_policy = policy resource.roles.grant downloader policy.roles.grant editor end it "should return the list of roles granted to the agents on the resource in resource scope, plus the roles granted to the agents on the resource's policy in policy scope" do expect(described_class.call(resource, agents).detach) .to eq(Roles::DetachedRoleSet.new([downloader, editor])) end end end
Version data entries
78 entries across 78 versions & 1 rubygems