set/abstract/permission.rb in card-mod-permissions-0.11.4 vs set/abstract/permission.rb in card-mod-permissions-0.11.5
- old
+ new
@@ -1,6 +1,5 @@
-
def standardize_items
super unless content == "_left"
end
def options_rule_card
@@ -82,10 +81,11 @@
@inheriting ||= inheritable? && card.content == "_left"
end
def inheritance_checkbox
return unless inheritable?
+
<<-HTML
<div class="perm-inheritance perm-section">
#{check_box_tag 'inherit', 'inherit', inheriting?}
<label>
#{core_inherit_content}
@@ -104,19 +104,20 @@
%(<span class="inherit-perm">#{text}</span>)
end
def in_context_of_self_set?
return false unless @set_context
+
@set_context.to_name.tag_name.key == Card[:self].key
end
def core_inherit_for_content_for_self_set
task = card.tag.codename
ancestor = Card[@set_context.trunk_name.trunk_name]
links = ancestor.who_can(task).map do |card_id|
link_to_card card_id, nil, target: args[:target]
end * ", "
"Inherit ( #{links} )"
- rescue
+ rescue StandardError
"Inherit"
end
end