public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType, bool immediate)
        {
            var where = Exp.Eq("userid", userId.ToString()) & Exp.Eq("groupid", groupId.ToString()) & Exp.Eq("ref_type", (int)refType);
            var i = immediate ?
                    Delete("core_usergroup", tenant).Where(where) :
                    (ISqlInstruction)Update("core_usergroup", tenant).Where(where).Set("removed", true).Set("last_modified", DateTime.UtcNow);
            var u = Update("core_user", tenant).Set("last_modified", DateTime.UtcNow).Where("id", userId.ToString());

            ExecBatch(i, u);
        }
        public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
        {
            Service.RemoveUserGroupRef(tenant, userId, groupId, refType);

            var r = new UserGroupRef(userId, groupId, refType)
            {
                Tenant = tenant
            };

            CacheUserGroupRefItem.Publish(r, CacheNotifyAction.Remove);
        }
Пример #3
0
 public static string CreateKey(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
 {
     return(tenant.ToString() + userId.ToString("N") + groupId.ToString("N") + ((int)refType).ToString());
 }
Пример #4
0
 public UserGroupRef(Guid userId, Guid groupId, UserGroupRefType refType)
 {
     UserId  = userId;
     GroupId = groupId;
     RefType = refType;
 }
Пример #5
0
 public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
 {
     RemoveUserGroupRef(tenant, userId, groupId, refType, false);
 }
Пример #6
0
 public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
 {
     service.RemoveUserGroupRef(tenant, userId, groupId, refType);
     InvalidateCache();
 }
Пример #7
0
 public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType, bool immediate)
 {
     var where = Exp.Eq("userid", userId.ToString()) & Exp.Eq("groupid", groupId.ToString()) & Exp.Eq("ref_type", (int)refType);
     var i = immediate ?
         Delete("core_usergroup", tenant).Where(where) :
         (ISqlInstruction)Update("core_usergroup", tenant).Where(where).Set("removed", true).Set("last_modified", DateTime.UtcNow);
     var u = Update("core_user", tenant).Set("last_modified", DateTime.UtcNow).Where("id", userId.ToString());
     ExecBatch(i, u);
 }
Пример #8
0
 public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
 {
     RemoveUserGroupRef(tenant, userId, groupId, refType, false);
 }
 public void RemoveUserGroupRef(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
 {
     service.RemoveUserGroupRef(tenant, userId, groupId, refType);
     InvalidateCache();
 }
Пример #10
0
 public static string CreateKey(int tenant, Guid userId, Guid groupId, UserGroupRefType refType)
 {
     return tenant.ToString() + userId.ToString("N") + groupId.ToString("N") + ((int)refType).ToString();
 }
Пример #11
0
 public UserGroupRef(Guid userId, Guid groupId, UserGroupRefType refType)
 {
     UserId = userId;
     GroupId = groupId;
     RefType = refType;
 }