lib/conjur/policy/resolver.rb in conjur-asset-policy-0.8.3 vs lib/conjur/policy/resolver.rb in conjur-asset-policy-0.11.0
- old
+ new
@@ -83,11 +83,11 @@
id = namespace
elsif id[0] == '/'
id = id[1..-1]
else
if record.respond_to?(:resource_kind) && record.resource_kind == "user"
- id = [ id, namespace ].compact.join('@')
+ id = [ id, user_namespace ].compact.join('@')
else
id = [ namespace, id ].compact.join('/')
end
end
@@ -106,9 +106,13 @@
ensure
@namespace = saved_namespace
end
protected
+
+ def user_namespace
+ namespace.gsub('/', '-') if namespace
+ end
def substitute! id
SUBSTITUTIONS.each do |k,v|
next unless value = send(v)
id.gsub! k, value