Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix of removal functions #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@author.io/iam",
"version": "1.0.0-alpha.6",
"version": "1.0.0-alpha.7",
"description": "A Identification and Authorization Management library.",
"main": "src/index.js",
"module": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/actors/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ export default class Group extends Trace {
}

destroy () {
for (const group of this.#memberOf.entries()) {
for (const group of this.#memberOf.values()) {
group.remove(this)
}

for (const user of this.#members.entries()) {
for (const user of this.#members.values()) {
user.leave(this)
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/actors/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export default class User extends Trace {
return true
}

for (const group of this.#memberOf.entries()) {
for (const group of this.#memberOf.valuees()) {
if (group.permitted(role)) {
return true
}
Expand All @@ -297,7 +297,7 @@ export default class User extends Trace {
* Destroy relations to the user.
*/
destroy () {
for (const group of this.#memberOf.entries()) {
for (const group of this.#memberOf.values()) {
group.remove(this)
}

Expand Down