1
1
# Identity and access management
2
2
3
- ## Compatibility note
4
-
5
- ** This demo has not yet been updated to be compatible with TypeDB 3.0**
6
-
7
3
## Introduction
8
4
9
5
In this demo, you'll learn how to use TypeDB as the database for an identity and access management system. We'll cover
10
6
some basic operations like listing the users in the system and see how queries can be simplified by taking advantage of
11
7
TypeDB's in-built type-inference and polymorphism, then move on to some more advanced examples that take advantage of
12
- rule-inference . We'll see how we can automate permission inheritance and enforce a dynamic segregation-of-duty policy at
8
+ TypeQL functions . We'll see how we can automate permission inheritance and enforce a dynamic segregation-of-duty policy at
13
9
the schema level.
14
10
15
11
![ Screenshot 2023-06-16 at 13 02 19] ( https://github.com/james-whiteside/typedb-examples/assets/117453030/f601ae73-1e43-455e-b7c1-226ce453967d )
@@ -19,36 +15,36 @@ the schema level.
19
15
This demo assumes knowledge of:
20
16
21
17
- [ General identity and access management concepts] ( https://en.wikipedia.org/wiki/Identity_management ) .
22
- - [ TypeDB's transaction system] ( https://typedb.com/docs/typedb/2.x/development/connect.html ) .
23
- - [ All basic TypeQL syntax elements] ( https://typedb.com/docs/typedb/2.x/dev/match.html ) .
24
- - [ TypeDB Studio's interface ] ( https://typedb.com/docs/clients/2.x/studio.html ) .
18
+ - [ TypeDB's transaction system] ( https://typedb.com/docs/manual/queries/transactions ) .
19
+ - [ All basic TypeQL syntax elements] ( https://typedb.com/docs/typeql/pipelines/ ) .
20
+ - [ TypeDB Studio] ( https://studio. typedb.com ) .
25
21
26
22
## Getting started
27
23
28
- Start your TypeDB server and open TypeDB Studio. Make sure you are on a ` schema-write ` transaction and run the following
24
+ Start your TypeDB server and open TypeDB Studio. Make sure you are on a ` schema ` transaction and run the following
29
25
TypeQL file:
30
26
31
- ``` define- schema.tql```
27
+ ``` schema.tql ```
32
28
33
- Then switch to a ` data- write` transaction and run the following:
29
+ Then switch to a ` write ` transaction and run the following:
34
30
35
- ``` insert- data.tql```
31
+ ``` data.tql ```
36
32
37
33
Remember to click on the green tick after running each of these scripts to commit the changes to the database.
38
34
39
35
## Running the examples
40
36
41
37
To get started, try running the examples. They are intended to be run once each and in order, so be aware that running
42
- them more than once or out of order might generate data errors. If anything goes wrong, you can run the
43
- ` insert-data.tql ` script again to reset everything. All the examples use ` data ` sessions, but you'll have to switch
44
- between ` read ` and ` write ` transactions depending on the queries in the example, and remember to commit after writes.
38
+ them more than once or out of order might generate data errors. If anything goes wrong, you can delete the dataabase &
39
+ run the ` setup-script.tqls ` script again to reset everything. For the examples, you'll have to switch between
40
+ ` read ` and ` write ` transactions depending on the queries in the example, and remember to commit after writes.
45
41
Each example has an accompanying exercise. You can skip them out and all the examples will still run fine. Some are
46
- much harder than others! All the solutions are in the ` solutions.tql ` file.
42
+ much harder than others! All the solutions are in the ` exercise- solutions.tql` file.
47
43
48
44
## Next steps
49
45
50
46
Once you've tried the pre-written examples out, have a go at editing them or writing something yourself. The schema also
51
47
has a lot of types that are not used in the example dataset, so try experimenting with those. Remember you can view the
52
48
list of types in the Type Browser, or view the schema in the graph visualizer by running the query:
53
49
54
- ``` match $t sub thing ; ```
50
+ ``` match $t sub $s ; ```
0 commit comments