feat: enforce friend add and curfew policies
This commit is contained in:
@@ -196,6 +196,21 @@ func (c *adminInternalClient) SensitiveWords(tenantCode string) (*types.Sensitiv
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func (c *adminInternalClient) SecurityPolicy(tenantCode string) (*types.SecurityPolicy, error) {
|
||||
var result types.SecurityPolicy
|
||||
path := "/internal/im-config/tenants/" + url.PathEscape(strings.TrimSpace(tenantCode)) + "/security-policy"
|
||||
if err := c.getJSON(path, nil, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if result.FriendDisabledPolicy == nil {
|
||||
result.FriendDisabledPolicy = map[string]any{}
|
||||
}
|
||||
if result.CurfewRules == nil {
|
||||
result.CurfewRules = []*types.MessageCurfewRule{}
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
func (c *adminInternalClient) TenantLoginIPWhitelist(id types.TenantID) (*tenantLoginIPWhitelistConfig, error) {
|
||||
if !id.IsValid() {
|
||||
return nil, types.ErrMalformed
|
||||
|
||||
Reference in New Issue
Block a user