Exemplo n.º 1
0
        public override void CreateRole(string roleName)
        {
            if (_App == null)
            {
                return;
            }
            role mRole = RoleSrv.GetByName(roleName, _App.AppID);

            if (mRole == null)
            {
                mRole       = new role();
                mRole.AppID = _App.AppID;
                mRole.name  = roleName;
                RoleSrv.CreateNew(mRole);
                RoleSrv.CommitChanges();
            }
        }
Exemplo n.º 2
0
        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
        {
            if (_App == null)
            {
                return(false);
            }
            role mRole = RoleSrv.GetByName(roleName, _App.AppID);

            if (mRole == null)
            {
                return(false);
            }
            try
            {
                RoleSrv.Delete(mRole);
                RoleSrv.CommitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }