-
Notifications
You must be signed in to change notification settings - Fork 0
/
amber-user-group-queries.R
43 lines (37 loc) · 1.1 KB
/
amber-user-group-queries.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
library(amberr)
# Start Amber session
a <- amber.login(username = "admin@obiba.org", password = "password", url = "http://localhost:3030")
# 2FA is requested if enabled for the user
# a <- amber.login(username = "jim@muse.com", password = "password123", url = "http://localhost:3030")
# Connection handle contains user ID and access token
a
#
# Users
#
# Find all users
amber.users(a)
# Find users with a specific email (only one expected)
amber.users(a, query = list(email = "jim@muse.com"))
# Find users with a specific role
amber.users(a, query = list(role = "guest"))
# Find users not having verified their email
amber.users(a, query = list(isVerified = "false"))
# Find a specific user by email or ID, get NULL if none are found
amber.user(a, id = "jim@muse.com")
amber.user(a, id = "615593fdda14d53617df7cc6")
amber.user(a, id = "jim@x.com")
#
# Groups
#
# Find all groups
amber.groups(a)
# Find group with a specific name or ID
amber.group(a, id = "obiba.org")
amber.group(a, id = "615abb061799dd6a2cdbbb10")
#
# Subjects
#
# Find all users and groups as subjects
amber.subjects(a)
# End Amber session
amber.logout(a)