williamdclt
12/07/2022, 2:32 PMgvf
12/07/2022, 2:48 PMJoey
12/07/2022, 3:23 PMcostap
12/07/2022, 3:28 PMJoey
12/07/2022, 3:29 PMcostap
12/07/2022, 3:31 PMJoey
12/07/2022, 3:32 PMcostap
12/07/2022, 3:38 PMcostap
12/07/2022, 3:52 PMnicolas123er
12/07/2022, 7:53 PMJoey
12/07/2022, 7:53 PMnicolas123er
12/07/2022, 7:56 PMJoey
12/07/2022, 7:56 PMJoey
12/07/2022, 7:57 PMnicolas123er
12/07/2022, 7:58 PMJoey
12/07/2022, 7:59 PMJoey
12/07/2022, 7:59 PMnicolas123er
12/07/2022, 8:01 PMhcguy
12/07/2022, 9:58 PMJoey
12/07/2022, 9:59 PMJoey
12/07/2022, 9:59 PMJoey
12/07/2022, 10:41 PMhcguy
12/07/2022, 11:15 PMJoey
12/07/2022, 11:17 PMcaveat only_on_tuesday(day_of_week string) {
day_of_week == 'tuesday'
}
definition user {}
definition resource {
relation viewer: user with only_on_tuesday
permission view = viewer
}
Joey
12/07/2022, 11:17 PMresource:someresource#viewer@user:someuser[only_on_tuesday]
and then pass in the current day_of_week
in the CheckPermission
requestJoey
12/07/2022, 11:19 PMcaveat ip_allowlist(user_ip ipaddress, cidr string) {
user_ip.in_cidr(cidr)
}
definition user {}
definition resource {
relation viewer: user with ip_allowlist
permission view = viewer
}
in this case, you could write the cidr
alongside the relationship: resource:someresource#viewer@user:someuser[ip_allowlist:{"cidr": "1.2.3.0"}]
and then pass the user's current user_ip
in the CheckPermission
requesthcguy
12/08/2022, 2:01 PMseeruyy
12/08/2022, 3:43 PMJoey
12/08/2022, 3:44 PMseeruyy
12/08/2022, 3:50 PM