package guardian
Role-based access control for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
0.0.5.tar.gz
md5=46f14b1dac8c7b7a1521c15555465dde
sha512=c9e7edab3f72a8764a37328c75001f9b7fbcedb1b68ecf95daf53fed4f7a46e9ce1ebc9d5fa9ad46d25f759857a95e7000173eef808aa0459339637a66e945f1
doc/src/guardian.backend/migrations.ml.html
Source file migrations.ml
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
let create_guardian_actors_table_sql = {sql| CREATE TABLE IF NOT EXISTS guardian_actors ( id TEXT UNIQUE NOT NULL, roles TEXT NOT NULL, parent TEXT ) |sql} ;; let create_guardian_targets_table_sql = {sql| CREATE TABLE IF NOT EXISTS guardian_targets ( id TEXT UNIQUE NOT NULL, roles TEXT NOT NULL, parent TEXT ) |sql} ;; let create_guardian_rules_table_sql = {sql| CREATE TABLE IF NOT EXISTS guardian_rules ( actor_id TEXT, actor_role TEXT, act TEXT NOT NULL, target_id TEXT, target_role TEXT, -- These constraints are necessary to prevent rules that cannot be -- represented within OCaml. CONSTRAINT only_one_actor CHECK( (actor_id IS NULL OR actor_role IS NULL) and (actor_id IS NOT NULL OR actor_role IS NOT NULL) ), CONSTRAINT only_one_target CHECK( (target_id IS NULL OR target_role IS NULL) and (target_id IS NOT NULL OR target_role IS NOT NULL) ), UNIQUE(actor_role, act, target_role), UNIQUE(actor_role, act, target_id), UNIQUE(actor_id, act, target_role), UNIQUE(actor_id, act, target_id) ) |sql} ;; let all_tables = [ "guardian_actors"; "guardian_targets"; "guardian_rules" ] let all = [ ( "create guardian actors table" , "2022-10-28T11:30" , create_guardian_actors_table_sql ) ; ( "create guardian rule table" , "2022-10-28T11:31" , create_guardian_rules_table_sql ) ; ( "create guardian targets table" , "2022-11-14T11:30" , create_guardian_targets_table_sql ) ] ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>