Skip to content

Commit 7cda6e0

Browse files
Luke SikinaLuke-Sikina
Luke Sikina
authored andcommitted
[CHORE] Create dict resource, add permissions
1 parent f0ffe95 commit 7cda6e0

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use auth;
2+
3+
SET @allowDictionaryRequests = unhex(REPLACE(UUID(),'-',''));
4+
-- Access rule for allowing requests to the uploader via proxy
5+
INSERT
6+
INTO access_rule (
7+
uuid, name, description, rule, type, value, checkMapKeyOnly, checkMapNode,
8+
subAccessRuleParent_uuid, isGateAnyRelation, isEvaluateOnlyByGates
9+
) VALUES (
10+
@allowDictionaryRequests, 'ALLOW_DICTIONARY_REQUESTS', 'Permit requests to dictionary endpoints',
11+
'$.[\'Target Service\']', 11, '^/proxy/dictionary-api.*$', 0x00, 0x00, NULL, 0x00, 0x00
12+
);
13+
-- Add that access rule to the PIC_SURE_ANY_QUERY privilege
14+
SET @uuidPriv = (SELECT uuid FROM privilege WHERE name = 'PIC_SURE_ANY_QUERY');
15+
INSERT
16+
INTO accessRule_privilege (privilege_id, accessRule_id)
17+
VALUES
18+
(@uuidPriv, @allowDictionaryRequests);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use picsure;
2+
3+
SET @dictResourceUUID = unhex(REPLACE(UUID(), '-', ''));
4+
5+
INSERT INTO `resource`
6+
(uuid, targetURL, resourceRSPath, description, name, token, hidden, metadata)
7+
VALUES
8+
(dictResourceUUID, NULL, 'http://dictionary-api/', 'Dictionary API', 'dictionary-api', NULL, TRUE, NULL);

0 commit comments

Comments
 (0)