Finalize read only and post only categories, finished off UI work

This commit is contained in:
Sam
2013-07-16 15:44:07 +10:00
parent fce2d0e3b6
commit 352ac9e60c
18 changed files with 204 additions and 94 deletions

View File

@ -276,8 +276,27 @@ describe Guardian do
end
end
describe 'a Topic' do
it 'should check for full permissions' do
category = Fabricate(:category)
category.set_permissions(:everyone => :create_post)
category.save
Guardian.new(user).can_create?(Topic,category).should be_false
end
end
describe 'a Post' do
it "is false on readonly categories" do
category = Fabricate(:category)
topic.category = category
category.set_permissions(:everyone => :readonly)
category.save
Guardian.new(topic.user).can_create?(Post, topic).should be_false
end
it "is false when not logged in" do
Guardian.new.can_create?(Post, topic).should be_false
end