示例#1
0
        private void CreateSystemUserGroupsIfNotExists(out BitplateUserGroup UserGroupAdmins, out BitplateUserGroup UserGroupEveryOne)
        {
            UserGroupAdmins = BaseObject.GetFirst <BitplateUserGroup>("FK_Site = '" + SessionObject.CurrentSite.ID + "' AND IsSystemValue = 1 AND Type=9");
            if (UserGroupAdmins == null)
            {
                UserGroupAdmins               = new BitplateUserGroup();
                UserGroupAdmins.Type          = UserTypeEnum.SiteAdmins;
                UserGroupAdmins.Name          = "Admins";
                UserGroupAdmins.IsSystemValue = true;
                UserGroupAdmins.Save();
            }

            UserGroupEveryOne = BaseObject.GetFirst <BitplateUserGroup>("FK_Site = '" + SessionObject.CurrentSite.ID + "' AND IsSystemValue = 1 AND Type=0");
            if (UserGroupEveryOne == null)
            {
                UserGroupEveryOne               = new BitplateUserGroup();
                UserGroupEveryOne.Type          = UserTypeEnum.Custom;
                UserGroupEveryOne.Name          = "Everyone";
                UserGroupEveryOne.IsSystemValue = true;
                UserGroupEveryOne.Save();
            }
        }
示例#2
0
 public void SaveUserGroup(BitplateUserGroup obj)
 {
     obj.Save();
 }