Skip to content

Instantly share code, notes, and snippets.

@bhenry
Created August 8, 2012 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhenry/44e29ca0118cc3910b08 to your computer and use it in GitHub Desktop.
Save bhenry/44e29ca0118cc3910b08 to your computer and use it in GitHub Desktop.
Brown, Sylvia (sbrown)
Brown, Nathan (wnkb)
Brown, Araina (arabrown)
Brown, Audrey (abrown)
(defremote list-subordinate-users [show-inactive]
(let [cu (current-user)]
(schema/list-subordinate-users (:subordinate-groups cu)
show-inactive
(admin? cu))))
(defn list-subordinate-users [subs & [show-inactive show-all]]
(select employee
(fields :id :firstname :lastname :username)
(where (if-not show-all
{:id [in (subselect
employee-group
(fields :employee_id)
(where {:group_id [in (map :id subs)]}))]}
{:id [> 0]}))
(order :lastname :asc :firstname :asc :username :asc)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment