瀏覽代碼

Fix bug where only highest access level worked

master
Christian Fischer 11 個月前
父節點
當前提交
b51f9f7469
共有 1 個檔案被更改,包括 8 行新增11 行删除
  1. +8
    -11
      server/resource.rkt

+ 8
- 11
server/resource.rkt 查看文件

@ -115,17 +115,14 @@
;; name, for a given resource, as accessible by the given user.
;; Returns #f if the user does not have access.
(define (access-action res user-id action-pair)
(let ((branch-id (car action-pair))
(action-id (cdr action-pair))
(mask (get-mask-for-user res
user-id))
(action-set (dict-ref resource-types (resource-type res))))
(if (string=? (hash-ref mask branch-id #f)
action-id)
(let* ((branch (hash-ref action-set branch-id))
(action (assoc action-id branch)))
(cdr action))
#f)))
(let* ((branch-id (car action-pair))
(action-id (cdr action-pair))
(mask (get-mask-for-user res
user-id))
(action-set (apply-mask (dict-ref resource-types (resource-type res))
mask)))
(cdr (assoc action-id (hash-ref action-set branch-id)))))
;; The general "no access" action -- may change in the future
(define no-access-action


載入中…
取消
儲存