package guardian
Role-based access control for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
0.1.0.tar.gz
md5=4aa712fb5ae59dc3483d4f1d84a59b97
sha512=b5b936f35d6a519760c100480a0e3748db23989d10d58b601d05b3c235dbe3ef0a9253676a5f6ce33b45ece9fd0caaba6ae9097fe2c73f370b7166051a4a2ec6
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
let create_guardian_actors_table_sql = {sql| CREATE TABLE IF NOT EXISTS guardian_actors ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, uuid binary(16) UNIQUE NOT NULL, roles TEXT NOT NULL, owner binary(16) NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id) ) |sql} ;; let create_guardian_targets_table_sql = {sql| CREATE TABLE IF NOT EXISTS guardian_targets ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, uuid binary(16) UNIQUE NOT NULL, kind varchar(255) NOT NULL, owner binary(16), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Following constraint already handled with a unique id -- CONSTRAINT unique_id_kind UNIQUE (uuid, kind), PRIMARY KEY (id) ) |sql} ;; let create_guardian_rules_table_sql = {sql| CREATE TABLE IF NOT EXISTS guardian_rules ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, actor_role varchar(255) NOT NULL, actor_uuid binary(16) NULL, act ENUM('create', 'read', 'update', 'delete', 'manage') NOT NULL, target_role varchar(255) NOT NULL, target_uuid binary(16) NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, CONSTRAINT actor_act_target UNIQUE (actor_role, actor_uuid, act, target_role, target_uuid), PRIMARY KEY (id) ) |sql} ;; let all_tables = [ "guardian_actors"; "guardian_targets"; "guardian_rules" ] let all = [ ( "create guardian actors table" , "2023-03-09T17:00" , create_guardian_actors_table_sql ) ; ( "create guardian rule table" , "2023-03-09T17:01" , create_guardian_rules_table_sql ) ; ( "create guardian targets table" , "2023-03-09T17:02" , create_guardian_targets_table_sql ) ] ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>