mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
Finalize read only and post only categories, finished off UI work
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user