add "is from local bubble instance" role condition
This commit is contained in:
parent
cace4153e4
commit
655290f8a4
5 changed files with 18 additions and 0 deletions
|
|
@ -262,6 +262,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
|||
return user.host.toLowerCase() === value.host.toLowerCase();
|
||||
}
|
||||
}
|
||||
// Is the user from a local bubble instance
|
||||
case 'fromBubbleInstance': {
|
||||
return user.host != null && this.meta.bubbleInstances.includes(user.host);
|
||||
}
|
||||
// サスペンド済みユーザである
|
||||
case 'isSuspended': {
|
||||
return user.isSuspended;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,13 @@ type CondFormulaValueIsFromInstance = {
|
|||
subdomains: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the user from a local bubble instance
|
||||
*/
|
||||
type CondFormulaValueFromBubbleInstance = {
|
||||
type: 'fromBubbleInstance';
|
||||
};
|
||||
|
||||
/**
|
||||
* 既に指定のマニュアルロールにアサインされている場合のみ成立とする
|
||||
*/
|
||||
|
|
@ -234,6 +241,7 @@ export type RoleCondFormulaValue = { id: string } & (
|
|||
CondFormulaValueIsLocal |
|
||||
CondFormulaValueIsRemote |
|
||||
CondFormulaValueIsFromInstance |
|
||||
CondFormulaValueFromBubbleInstance |
|
||||
CondFormulaValueIsSuspended |
|
||||
CondFormulaValueIsLocked |
|
||||
CondFormulaValueIsBot |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue