mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:22:26 -05:00
[bugfix] Fix existing perm adoption (#3651)
* [bugfix] Fix existing perm adoption * go fmt * test, small log fix
This commit is contained in:
parent
81b66ad7e3
commit
634d4f408f
7 changed files with 225 additions and 18 deletions
|
|
@ -104,3 +104,7 @@ func (d *DomainAllow) SetSubscriptionID(i string) {
|
|||
func (d *DomainAllow) GetType() DomainPermissionType {
|
||||
return DomainPermissionAllow
|
||||
}
|
||||
|
||||
func (d *DomainAllow) IsOrphan() bool {
|
||||
return d.SubscriptionID == ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,3 +104,7 @@ func (d *DomainBlock) SetSubscriptionID(i string) {
|
|||
func (d *DomainBlock) GetType() DomainPermissionType {
|
||||
return DomainPermissionBlock
|
||||
}
|
||||
|
||||
func (d *DomainBlock) IsOrphan() bool {
|
||||
return d.SubscriptionID == ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ type DomainPermission interface {
|
|||
GetSubscriptionID() string
|
||||
SetSubscriptionID(i string)
|
||||
GetType() DomainPermissionType
|
||||
|
||||
// Return true if this DomainPermission
|
||||
// does not have a subscription id set.
|
||||
IsOrphan() bool
|
||||
}
|
||||
|
||||
// Domain permission type.
|
||||
|
|
|
|||
|
|
@ -104,3 +104,7 @@ func (d *DomainPermissionDraft) SetSubscriptionID(i string) {
|
|||
func (d *DomainPermissionDraft) GetType() DomainPermissionType {
|
||||
return d.PermissionType
|
||||
}
|
||||
|
||||
func (d *DomainPermissionDraft) IsOrphan() bool {
|
||||
return d.SubscriptionID == ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,3 +90,4 @@ func (d *DomainPermissionExclude) SetObfuscate(_ *bool) {}
|
|||
func (d *DomainPermissionExclude) GetSubscriptionID() string { return "" }
|
||||
func (d *DomainPermissionExclude) SetSubscriptionID(_ string) {}
|
||||
func (d *DomainPermissionExclude) GetType() DomainPermissionType { return DomainPermissionUnknown }
|
||||
func (d *DomainPermissionExclude) IsOrphan() bool { return true }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue