@cocreate/authorize 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/CoCreate.config.js +1 -2
- package/docs/index.html +2 -2
- package/package.json +3 -3
- package/src/index.js +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.8.2](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.8.1...v1.8.2) (2023-11-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump dependencies for latest features ([696dd55](https://github.com/CoCreate-app/CoCreate-authorize/commit/696dd55c610aff4b29d378ecf91b20e824392322))
|
|
7
|
+
|
|
8
|
+
## [1.8.1](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.8.0...v1.8.1) (2023-11-09)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* meta name typo ([a21a4b5](https://github.com/CoCreate-app/CoCreate-authorize/commit/a21a4b5a8b92d17dabb9d60274526e43235ef9d5))
|
|
14
|
+
* return error if no authorization.actions ([61cff63](https://github.com/CoCreate-app/CoCreate-authorize/commit/61cff637a565305032fc4356b24b039e428d7b6d))
|
|
15
|
+
* typos ([48eecb4](https://github.com/CoCreate-app/CoCreate-authorize/commit/48eecb43925bf0b70d7daabb5e82a5d7cd5e305f))
|
|
16
|
+
* update crud methods ([c416245](https://github.com/CoCreate-app/CoCreate-authorize/commit/c41624522c9688321b5cdb7c2c401b38cc057ead))
|
|
17
|
+
* update host ([a86a448](https://github.com/CoCreate-app/CoCreate-authorize/commit/a86a4489d6fbc18c3989735db1edf4fb0125fb15))
|
|
18
|
+
|
|
1
19
|
# [1.8.0](https://github.com/CoCreate-app/CoCreate-authorize/compare/v1.7.6...v1.8.0) (2023-11-03)
|
|
2
20
|
|
|
3
21
|
|
package/CoCreate.config.js
CHANGED
package/docs/index.html
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
sizes="32x32"
|
|
12
12
|
href="https://cocreate.app/images/favicon.ico" />
|
|
13
13
|
<meta
|
|
14
|
-
|
|
14
|
+
name="description"
|
|
15
15
|
content="A simple HTML5 and pure javascript component. Easy configuration using data-attributes and highly styleable." />
|
|
16
16
|
<meta
|
|
17
|
-
|
|
17
|
+
name="keywords"
|
|
18
18
|
content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
19
19
|
<meta name="robots" content="index,follow" />
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/authorize",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "A simple authorize component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authorize",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"main": "./src/index.js",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cocreate/crud-client": "^1.28.
|
|
49
|
-
"@cocreate/utils": "^1.
|
|
48
|
+
"@cocreate/crud-client": "^1.28.14",
|
|
49
|
+
"@cocreate/utils": "^1.27.1"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/index.js
CHANGED
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
const organizations = {}
|
|
19
19
|
|
|
20
20
|
if (isBrowser) {
|
|
21
|
-
crud.listen('update
|
|
21
|
+
crud.listen('object.update', function (data) {
|
|
22
22
|
updateAuthorization(data)
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
crud.listen('delete
|
|
25
|
+
crud.listen('object.delete', function (data) {
|
|
26
26
|
deleteAuthorization(data)
|
|
27
27
|
});
|
|
28
28
|
} else {
|
|
@@ -190,6 +190,8 @@
|
|
|
190
190
|
}
|
|
191
191
|
if (authorized.admin === 'true' || authorized.admin === true)
|
|
192
192
|
return true;
|
|
193
|
+
if (!authorized.actions)
|
|
194
|
+
return { error: "Authorization does not have any actions defined" };
|
|
193
195
|
|
|
194
196
|
let status = await checkMethod(data, authorized.actions, data.method)
|
|
195
197
|
|
|
@@ -238,7 +240,7 @@
|
|
|
238
240
|
return !!authorized
|
|
239
241
|
} else {
|
|
240
242
|
let status = false
|
|
241
|
-
let newmatch = data.method.replace(match, '')
|
|
243
|
+
let newmatch = data.method.replace(match + '.', '')
|
|
242
244
|
|
|
243
245
|
if (Array.isArray(authorized)) {
|
|
244
246
|
for (let i = 0; i < authorized.length; i++) {
|