Skip to content

Commit 7335a62

Browse files
committed
fixup! Use SpiceDB for lease-related auth checks
1 parent c7d0241 commit 7335a62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/declarative_authorization/authorization.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def permit!(privilege, options = {})
267267
# Check if the lease document is a renewal
268268
response = @auth_service.lookup_subjects(
269269
resource_type: "lease_document",
270-
resource_id: options[:object]&.lease_uuid,
270+
resource_id: options[:object]&.lease_document_uuid,
271271
permission: "renewal",
272272
subject_type: "lease_document",
273273
)
@@ -285,6 +285,8 @@ def permit!(privilege, options = {})
285285
end
286286

287287
if condition_matched
288+
# For now, we will assume each rule's conditions are OR'd together. This is not the case
289+
# for all rules, but it's the most common case and a good starting point.
288290
puts " At least one matching condition found, checking spicedb"
289291

290292
authorized = @auth_service.check_permission(

0 commit comments

Comments
 (0)