organizations 0.7.0 → 0.7.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +18 -1
- data/lib/organizations/models/concerns/has_organizations.rb +7 -0
- data/lib/organizations/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fba49577a4eb70a0bd69d5b554609a3a3b5a73046f1b0007219773b2e3cccd48
|
|
4
|
+
data.tar.gz: 8eba41990e24a6558de87d4760fabf09b65561fd43e4314e27f58ec5d838dbc3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f49c6a4eba6854e3988c2a39d175f5616af10ef8723e3c6f91d461ca8f3bc4151cb9ddc64e0baf5ff5a83e474690eacc86362d149354c46e72c97b92bf2e9c7a
|
|
7
|
+
data.tar.gz: 9b83cc21331c095d64ea22ba5f4874a11716e634f2dffd664a7b5b3ed4768c9ac048e2f03a4c93bddd92e3661d6003dceeac0edc21f671c5ff327dff4241490e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.7.1] - 2026-10-19
|
|
4
|
+
|
|
5
|
+
**A user whose invitation was accepted can now be deleted.** A patch release with one fix and one README correction. No migration is needed.
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **A user whose invitation was accepted could not be deleted.** Accepting an invitation copies the inviter into `organizations_memberships.invited_by_id`, whose foreign key has no `ON DELETE` rule, and nothing cleared it. `user.destroy` raised `ActiveRecord::InvalidForeignKey` and rolled back, whatever `account_deletion_policy` said. `has_organizations` now declares `invited_organization_memberships` with `dependent: :nullify`, as it does for sent invitations. No migration is needed. A deletion path that skips callbacks (`delete`, raw SQL) still meets the foreign key: give it `ON DELETE SET NULL` in your own migration if you have one.
|
|
10
|
+
- README: the scoped resource grants example redefined only `viewer` and `member` in `config.roles`. A block that redefines a built-in role defines only the built-in roles it lists, so `admin` and `owner` were left with no permissions. The example now lists all four roles.
|
|
11
|
+
|
|
3
12
|
## [0.7.0] - 2026-10-18
|
|
4
13
|
|
|
5
14
|
**Personal organizations, safe account deletion, domain authority, join screens, vocabularies and scoped resource grants.** This release closes issue #21. Every new feature is opt-in: an existing app that upgrades and runs `rails g organizations:upgrade` keeps its behaviour, apart from the changes listed under "Changed".
|
data/README.md
CHANGED
|
@@ -1012,19 +1012,36 @@ rails db:migrate
|
|
|
1012
1012
|
Capabilities are checked against the role's permissions, so give your roles the capabilities they may use on granted records (custom roles work too):
|
|
1013
1013
|
|
|
1014
1014
|
```ruby
|
|
1015
|
+
# A block that redefines a built-in role defines only the built-in roles it
|
|
1016
|
+
# lists, so list all four: these are the defaults plus the capabilities.
|
|
1015
1017
|
config.roles do
|
|
1016
1018
|
role :viewer do
|
|
1017
1019
|
can :view_organization
|
|
1020
|
+
can :view_members
|
|
1018
1021
|
can :read
|
|
1019
1022
|
end
|
|
1020
1023
|
role :client, inherits: :viewer do # a narrow custom role
|
|
1021
1024
|
can :comment
|
|
1022
1025
|
end
|
|
1023
1026
|
role :member, inherits: :viewer do
|
|
1027
|
+
can :create_resources
|
|
1028
|
+
can :edit_own_resources
|
|
1029
|
+
can :delete_own_resources
|
|
1024
1030
|
can :comment
|
|
1025
1031
|
can :edit
|
|
1026
1032
|
end
|
|
1027
|
-
|
|
1033
|
+
role :admin, inherits: :member do
|
|
1034
|
+
can :invite_members
|
|
1035
|
+
can :remove_members
|
|
1036
|
+
can :edit_member_roles
|
|
1037
|
+
can :manage_settings
|
|
1038
|
+
can :view_billing
|
|
1039
|
+
end
|
|
1040
|
+
role :owner, inherits: :admin do
|
|
1041
|
+
can :manage_billing
|
|
1042
|
+
can :transfer_ownership
|
|
1043
|
+
can :delete_organization
|
|
1044
|
+
end
|
|
1028
1045
|
end
|
|
1029
1046
|
```
|
|
1030
1047
|
|
|
@@ -105,6 +105,13 @@ module Organizations
|
|
|
105
105
|
inverse_of: :invited_by,
|
|
106
106
|
dependent: :nullify
|
|
107
107
|
|
|
108
|
+
# Memberships those invitations became. Nullified on deletion like
|
|
109
|
+
# the invitations: the install migration gives invited_by_id a
|
|
110
|
+
# foreign key with no ON DELETE rule, so without this the database
|
|
111
|
+
# refuses to delete anyone whose invitation was accepted.
|
|
112
|
+
has_many :invited_organization_memberships, class_name: "Organizations::Membership",
|
|
113
|
+
foreign_key: :invited_by_id, inverse_of: :invited_by, dependent: :nullify
|
|
114
|
+
|
|
108
115
|
define_verified_joining_associations
|
|
109
116
|
end
|
|
110
117
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: organizations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rameerez
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-10-
|
|
10
|
+
date: 2026-10-19 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: railties
|