diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-09-05 22:43:48 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-09-06 22:07:20 +0300 |
commit | edf8dd44f7676d14fda5ce305c2c3e31b8c14c17 (patch) | |
tree | e4ca7a32c803deb20477936f80e29cb8186d326c /app/helpers/groups_helper.rb | |
parent | c7e17abd269e31a59c41687459eea6382475ab95 (diff) |
Simplify disabling checkbox
Diffstat (limited to 'app/helpers/groups_helper.rb')
-rw-r--r-- | app/helpers/groups_helper.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index e22e2c2e418..62ad16314bf 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -3,6 +3,10 @@ module GroupsHelper can?(current_user, :change_visibility_level, group) end + def can_change_share_with_group_lock?(group) + can?(current_user, :change_share_with_group_lock, group) + end + def group_icon(group) if group.is_a?(String) group = Group.find_by_full_path(group) @@ -65,14 +69,6 @@ module GroupsHelper { group_name: group.name } end - def share_with_group_lock_disabled - return false unless @group.has_parent? - return false unless @group.parent.share_with_group_lock? - return false unless @group.share_with_group_lock? - return false if @group.has_owner?(current_user) - return true - end - def share_with_group_lock_help_text return default_help unless @group.has_parent? return default_help unless @group.parent.share_with_group_lock? |