mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #12368 from rainzm/notify/fix
Fixes for Notify Subscribers
This commit is contained in:
@@ -905,7 +905,6 @@ func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCreden
|
||||
mobile := input.InternationalMobile.String()
|
||||
if len(mobile) != 0 && mobile != r.Mobile {
|
||||
r.VerifiedMobile = tristate.False
|
||||
r.Mobile = mobile
|
||||
for _, c := range r.subContactCache {
|
||||
if c.ParentContactType == api.MOBILE {
|
||||
c.Verified = tristate.False
|
||||
@@ -935,6 +934,7 @@ func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCreden
|
||||
r.VerifiedMobile = tristate.True
|
||||
}
|
||||
}
|
||||
r.Mobile = mobile
|
||||
err = ReceiverManager.TableSpec().InsertOrUpdate(ctx, r)
|
||||
if err != nil {
|
||||
log.Errorf("InsertOrUpdate: %v", err)
|
||||
|
||||
@@ -43,7 +43,7 @@ type SSubscriberReceiverManager struct {
|
||||
type SSubscriberReceiver struct {
|
||||
db.SJointResourceBase
|
||||
SubscriberId string `width:"36" charset:"ascii" nullable:"false" index:"true"`
|
||||
ReceiverId string `width:"36" charset:"ascii" nullable:"false" index:"true"`
|
||||
ReceiverId string `width:"128" charset:"ascii" nullable:"false" index:"true"`
|
||||
}
|
||||
|
||||
func (srm *SSubscriberReceiverManager) GetMasterFieldName() string {
|
||||
|
||||
@@ -133,6 +133,48 @@ var (
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Auth: true,
|
||||
Scope: rbacutils.ScopeDomain,
|
||||
Rules: []rbacutils.SRbacRule{
|
||||
{
|
||||
Service: api.SERVICE_TYPE,
|
||||
Resource: "subscribers",
|
||||
Action: PolicyActionGet,
|
||||
Result: rbacutils.Allow,
|
||||
},
|
||||
{
|
||||
Service: api.SERVICE_TYPE,
|
||||
Resource: "subscribers",
|
||||
Action: PolicyActionList,
|
||||
Result: rbacutils.Allow,
|
||||
},
|
||||
{
|
||||
Service: api.SERVICE_TYPE,
|
||||
Resource: "subscribers",
|
||||
Action: PolicyActionCreate,
|
||||
Result: rbacutils.Allow,
|
||||
},
|
||||
{
|
||||
Service: api.SERVICE_TYPE,
|
||||
Resource: "subscribers",
|
||||
Action: PolicyActionUpdate,
|
||||
Result: rbacutils.Allow,
|
||||
},
|
||||
{
|
||||
Service: api.SERVICE_TYPE,
|
||||
Resource: "subscribers",
|
||||
Action: PolicyActionDelete,
|
||||
Result: rbacutils.Allow,
|
||||
},
|
||||
{
|
||||
Service: api.SERVICE_TYPE,
|
||||
Resource: "subscribers",
|
||||
Action: PolicyActionPerform,
|
||||
Result: rbacutils.Allow,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user