-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathauth.js
More file actions
73 lines (69 loc) · 1.41 KB
/
auth.js
File metadata and controls
73 lines (69 loc) · 1.41 KB
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
63
64
65
66
67
68
69
70
71
72
73
/**
* Authorization outcome.
*
* @readonly
* @enum {number}
* @property {number} ALLOW - Allow access to a resource.
* @property {number} DENY - Deny access to a resource and throw an error.
* @property {number} IGNORE - For READ: return NULL instead of the column value. For other actions: equivalent to DENY.
*/
const Authorization = {
/**
* Allow access to a resource.
* @type {number}
*/
ALLOW: 0,
/**
* Deny access to a resource and throw an error in `prepare()`.
* @type {number}
*/
DENY: 1,
/**
* For READ: return NULL instead of the actual column value.
* For other actions: equivalent to DENY.
* @type {number}
*/
IGNORE: 2,
};
/**
* SQLite authorizer action codes.
*
* @readonly
* @enum {number}
*/
const Action = {
CREATE_INDEX: 1,
CREATE_TABLE: 2,
CREATE_TEMP_INDEX: 3,
CREATE_TEMP_TABLE: 4,
CREATE_TEMP_TRIGGER: 5,
CREATE_TEMP_VIEW: 6,
CREATE_TRIGGER: 7,
CREATE_VIEW: 8,
DELETE: 9,
DROP_INDEX: 10,
DROP_TABLE: 11,
DROP_TEMP_INDEX: 12,
DROP_TEMP_TABLE: 13,
DROP_TEMP_TRIGGER: 14,
DROP_TEMP_VIEW: 15,
DROP_TRIGGER: 16,
DROP_VIEW: 17,
INSERT: 18,
PRAGMA: 19,
READ: 20,
SELECT: 21,
TRANSACTION: 22,
UPDATE: 23,
ATTACH: 24,
DETACH: 25,
ALTER_TABLE: 26,
REINDEX: 27,
ANALYZE: 28,
CREATE_VTABLE: 29,
DROP_VTABLE: 30,
FUNCTION: 31,
SAVEPOINT: 32,
RECURSIVE: 33,
};
module.exports = { Authorization, Action };