Skip to content

Commit

Permalink
deprecated metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
callum-oakley committed Aug 15, 2022
1 parent 82ecebd commit fddbf97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drafter/src/drafter/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
:manager (conj (role->permissions :publisher) :drafter:draft:claim:manager)
:system (recur :manager)))

(defn permissions->role
(defn ^{:deprecated "For backward compatibility only"} permissions->role
"This is a shim to provide a role in the API when we only have permissions
internally. Deprecated and only to be used for backward compatibility."
[permissions]
(first (filter (fn [role] (set/subset? (role->permissions role) permissions))
[:manager :publisher :editor :access :norole])))

(def role->canonical-permission
(def ^{:deprecated "For backward compatibility only"} role->canonical-permission
"Maps a role to a permission that that role has, but less privileged roles
don't have. Deprecated, for backward compatibility only."
{"editor" "drafter:draft:edit"
"publisher" "drafter:draft:publish"
"manager" "drafter:draft:claim:manager"})

(def canonical-permission->role
(def ^{:deprecated "For backward compatibility only"} canonical-permission->role
"Deprecated, for backward compatibility only."
(set/map-invert role->canonical-permission))

Expand Down

0 comments on commit fddbf97

Please sign in to comment.