Skip to content

Commit

Permalink
Merge branch 'release/0.4.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
deyhle committed Jan 13, 2021
2 parents 341e703 + 2bbdc20 commit 284ae6a
Show file tree
Hide file tree
Showing 8 changed files with 3,465 additions and 2,499 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
@@ -1,8 +1,9 @@
language: node_js
node_js:
- "14"
- "12"
- "10"
- "8"
- "6"
script: "npm run-script test-travis"
# Send coverage data to Coveralls
after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
186 changes: 186 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,186 @@
## <small>0.4.10 (2021-01-13)</small>

* fix: order of permissions irrelevant ([1260fcd](https://github.com/entrecode/shiro-trie/commit/1260fcd)), closes [#147](https://github.com/entrecode/shiro-trie/issues/147)
* chore: new changelog ([48e9c65](https://github.com/entrecode/shiro-trie/commit/48e9c65))
* chore: updated travis.yml ([cd45e20](https://github.com/entrecode/shiro-trie/commit/cd45e20))
* chore(package): update coveralls to version 3.0.8 ([b27be6b](https://github.com/entrecode/shiro-trie/commit/b27be6b)), closes [#142](https://github.com/entrecode/shiro-trie/issues/142)
* chore(package): update coveralls to version 3.0.9 ([b71921d](https://github.com/entrecode/shiro-trie/commit/b71921d)), closes [#142](https://github.com/entrecode/shiro-trie/issues/142)
* chore(package): update karma to version 4.0.0 ([6d995b1](https://github.com/entrecode/shiro-trie/commit/6d995b1))
* chore(package): update lockfile package-lock.json ([c418016](https://github.com/entrecode/shiro-trie/commit/c418016))
* chore(package): update lockfile package-lock.json ([8a8d4c4](https://github.com/entrecode/shiro-trie/commit/8a8d4c4))
* chore(package): update lockfile package-lock.json ([f396e88](https://github.com/entrecode/shiro-trie/commit/f396e88))
* chore(package): update package-lock.json ([53f91bf](https://github.com/entrecode/shiro-trie/commit/53f91bf))
* chore(package): Bump http-proxy from 1.17.0 to 1.18.1 ([002effa](https://github.com/entrecode/shiro-trie/commit/002effa))
* test: restored node 8 support ([d71deb7](https://github.com/entrecode/shiro-trie/commit/d71deb7))



## <small>0.4.9 (2019-10-30)</small>

* fix: made sure that permissions like `a:*:c` don't overwrite `a:*` - star at end trumps all ([3dbf518](https://github.com/entrecode/shiro-trie/commit/3dbf518))



## <small>0.4.8 (2018-08-31)</small>

* chore(package): dependency update



## <small>0.4.7 (2018-05-22)</small>

* feat: #132 add return type to constructor definition ([3bf732f](https://github.com/entrecode/shiro-trie/commit/3bf732f)), closes [#132](https://github.com/entrecode/shiro-trie/issues/132)



## <small>0.4.6 (2018-05-05)</small>

* feat: Better support for querying permissions with wildcards, any, and sub-rights: querying for permissions `a:b:*:c` with query `a:?:$:d` resulting in `b` instead of `[]`. ([4778e8e](https://github.com/entrecode/shiro-trie/commit/4778e8e)), closes [#129](https://github.com/entrecode/shiro-trie/issues/129)



## <small>0.4.5 (2018-02-09)</small>

* fix: a permission where an explicit star at the end would not overpower previous more fine-granular ([4086906](https://github.com/entrecode/shiro-trie/commit/4086906))



## <small>0.4.4 (2018-01-30)</small>

* fix: optimized last fix for permission including * and current one ([6ead538](https://github.com/entrecode/shiro-trie/commit/6ead538))



## <small>0.4.3 (2018-01-30)</small>

- fix: querying for permissions `a:*:b` with query `a:c:?` not resulting in `b`, closes [#118](https://github.com/entrecode/shiro-trie/issues/118) [#119](https://github.com/entrecode/shiro-trie/issues/119)



## <small>0.4.2 (2017-12-05)</small>

* fix: a bug where a star permission would be overwritten ([19b47f4](https://github.com/entrecode/shiro-trie/commit/19b47f4))



## <small>0.4.1 (2017-11-29)</small>

* fix: a bug where a permission `a:*:c` would overwrite `a:b:c,d` so that `a:b:d` would return `false` ([bc6876c](https://github.com/entrecode/shiro-trie/commit/bc6876c))



## 0.4.0 (2017-08-31)

* feat: adds typescript typings ([5723b1c](https://github.com/entrecode/shiro-trie/commit/5723b1c))



## <small>0.3.13 (2017-04-11)</small>

* chore(package): dependency update



## <small>0.3.12 (2016-11-21)</small>

* feat: redefined query to include implicit ‘$’ at end ([0d927a0](https://github.com/entrecode/shiro-trie/commit/0d927a0))



## <small>0.3.11 (2016-11-18)</small>

* feat: permission query now supports multiple any ($bling$) ([3d294bd](https://github.com/entrecode/shiro-trie/commit/3d294bd))



## <small>0.3.10 (2016-11-17)</small>

* fix: proper handling of single $ after ? in permission query ([24a07a9](https://github.com/entrecode/shiro-trie/commit/24a07a9))



## <small>0.3.9 (2016-11-15)</small>

* chore(package): dependency update



## <small>0.3.8 (2016-08-23)</small>

* chore(package): dependency update ([c5e6ba6](https://github.com/entrecode/shiro-trie/commit/c5e6ba6))



## <small>0.3.7 (2016-04-25)</small>

* chore(package): dependency update ([b66710e](https://github.com/entrecode/shiro-trie/commit/b66710e))



## <small>0.3.6 (2016-02-17)</small>

* refactor: do not put uniq into Array.prototype, version 0.3.6 ([26e01c3](https://github.com/entrecode/shiro-trie/commit/26e01c3))



## <small>0.3.5 (2016-02-17)</small>

* refactor: removed lodash from module ([37dea69](https://github.com/entrecode/shiro-trie/commit/37dea69))
* test: adds karma tests so we know browsers will work :) ([5dd131f](https://github.com/entrecode/shiro-trie/commit/5dd131f))



## <small>0.3.4 (2016-02-12)</small>

* chore(package): dependency updates


## <small>0.3.3 (2016-02-05)</small>

* chore(package): dependency updates



## <small>0.3.2 (2015-12-10)</small>

* chore(package): dependency updates



## <small>0.3.1 (2015-11-06)</small>

* chore(package): pin dependencies ([4dd92ad](https://github.com/entrecode/shiro-trie/commit/4dd92ad))



## 0.3.0 (2015-09-07)

* feat: added support for , in check() ([8b01fae](https://github.com/entrecode/shiro-trie/commit/8b01fae))



## <small>0.2.1 (2015-09-01)</small>

* test: added browserify to devDependencies ([537d856](https://github.com/entrecode/shiro-trie/commit/537d856))
* test: moved browserify task to build-script ([d3d8be5](https://github.com/entrecode/shiro-trie/commit/d3d8be5))



## 0.2.0 (2015-09-01)

* chore: bower support added ([cd62428](https://github.com/entrecode/shiro-trie/commit/cd62428))



## <small>0.1.1 (2015-08-03)</small>

* chore: updated dependencies ([39ce309](https://github.com/entrecode/shiro-trie/commit/39ce309))



## 0.1.0 (2015-08-03)

* feat: initial release



84 changes: 1 addition & 83 deletions README.md
Expand Up @@ -198,89 +198,7 @@ $ istanbul cover _mocha -- -R spec
## Changelog
### 0.4.9
- made sure that permissions like `a:*:c` don't overwrite `a:*`
### 0.4.8
- removed lodash dependency in readme
- applied patches
### 0.4.7
- fixed typings returntype of constructor
### 0.4.6
- fixed querying for permissions `a:b:*:c` with query `a:?:$:d` resulting in `b` instead of `[]`.
### 0.4.5
- fixed a permission where an explicit star at the end would not overpower previous more fine-granular permissions
### 0.4.3 and 0.4.4
- fixed querying for permissions `a:*:b` with query `a:c:?` not resulting in `b`.
### 0.4.2
- fixed a bug where a star permission would be overwritten
### 0.4.1
- fixed a bug where a permission `a:*:c` would overwrite `a:b:c,d` so that `a:b:d` would return `false`
### 0.4.0
- added typescript typings
### 0.3.13
- dependency update
### 0.3.12
- permission queries now have an implicit `$` at the end
### 0.3.11
- permission query now supports multiple `$`
### 0.3.10
- proper handling of `$` after `?` in permission query
### 0.3.9
- dependency update
### 0.3.8
- dependency update
### 0.3.7
- dependency update
### 0.3.6
- do not put uniq into Array.prototype
### 0.3.5
- removed dependency lodash. shiro-trie is super slim now.
### 0.3.4
- dependency update
### 0.3.3
- dependency update
### 0.3.2
- dependency update
### 0.3.1
- dependency update
### 0.3.0
- support for `,` in `check(…)`
### 0.2.1
- bug fixes
### 0.2.0
- Renamed package to shiro-trie
- Added bower support
### 0.1.1
- Updated dependencies
### 0.1.0
- Initial Release
see [CHANGELOG.md](./CHANGELOG.md)
## License
MIT © [entrecode GmbH](https://entrecode.de)
Expand Down
5 changes: 2 additions & 3 deletions dist/shiro-trie.js
Expand Up @@ -14,7 +14,7 @@ function uniq(arr) {
}

function _add(trie, array) {
var i, j, node, prevNode, values, goRecursive;
var i, j, node, values, goRecursive;
node = trie;
goRecursive = false;
// go through permission string array
Expand All @@ -39,13 +39,12 @@ function _add(trie, array) {
i = array.length;
} else {
// if we don't need recursion, we just go deeper
prevNode = node;
node = node[values[j]];
}
}
}
// if we did not went recursive, we close the Trie with a * leaf
if (!goRecursive && (!prevNode || !prevNode.hasOwnProperty('*'))) {
if (!goRecursive) {
node['*'] = {};
}
return trie;
Expand Down
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -13,7 +13,7 @@ function uniq(arr) {
}

function _add(trie, array) {
var i, j, node, prevNode, values, goRecursive;
var i, j, node, values, goRecursive;
node = trie;
goRecursive = false;
// go through permission string array
Expand All @@ -38,13 +38,12 @@ function _add(trie, array) {
i = array.length;
} else {
// if we don't need recursion, we just go deeper
prevNode = node;
node = node[values[j]];
}
}
}
// if we did not went recursive, we close the Trie with a * leaf
if (!goRecursive && (!prevNode || !prevNode.hasOwnProperty('*'))) {
if (!goRecursive) {
node['*'] = {};
}
return trie;
Expand Down

0 comments on commit 284ae6a

Please sign in to comment.