package guardian
Role-based access control for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
0.0.4.tar.gz
md5=45ecb4358a2405a3b4cc263f25ad995c
sha512=d070bd79c14123f720bd0c14291ee520bda3bfac5d6ceb58ceb85185c9be4cebbc5c99894ce29b62bf9e2ed4291ae094506d4d176c12945e99ed9d0283f55db8
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)"
>