Skip to content

Refactors AccessLevel to use integer flags

Gabriel Silva requested to merge gabrielssilva/noosfero:show_person_wall into master

Closes #241 (closed)

wall_access uses a default users value. However, for some reason the current settings_item implementation translates String default with the following code snippet.

if not val.nil? then val elsif default.is_a? String then gettext default else default end

When using Noosfero in a language that translates the users String, the profile wall may not appear, as it will not be considered in the AccessLevel conditions.

Maybe we can keep the settings_item translation using another solution (like set the value in after_save instead of using a default value), but the bug can happen again in the future. Anyway, we can always translate the value manually. E.g.:

settings_items :a_translated_setting, :type => :string, :default => _('some string')

Merge request reports