edtsech / redmine_wiki_permissions

This redmine plugin adding permissions for every wiki page (need a maintainer)
32 stars 16 forks source link

Can't see not working #10

Open alvila opened 13 years ago

alvila commented 13 years ago

I don't know if this is my mistake or an issue but the can't see permission actually doesn't work.

I fixed it by adding an option on the first line <% if !@page.users_by_level(0).include?(User.current) %> and end on the last line, but this doesn't seem right.

Anyway is there any way of making the can't see default for not specified users? It would be useful to add this feature. I can do it if you like.

alvila commented 13 years ago

The change was in show.html.erb

alvila commented 13 years ago

Ok found the option can_view so I changed to <% if User.current.can_view?(@page) %>

The option in lib/wiki_permisions.rb result.class == WikiPage and not User.current.can_view? result seems not to do what it should do.

alvila commented 13 years ago

Ok found it, the permission works only on sub-page not on the main one. Now the issue is that if the user is not defined, it throws internal error.