Exemplo n.º 1
0
        public ActionResult RemoverPermissaoConfirmacao(int pfid, int pmid)
        {
            RBAC_Link_Perfil_Permissao lpp = db.RBAC_Link_Perfil_Permissao.Where(o => o.Perfil_ID == pfid && o.Permissao_ID == pmid).FirstOrDefault();

            db.RBAC_Link_Perfil_Permissao.Remove(lpp);
            db.SaveChanges();
            return(RedirectToAction("Detalhes", new { id = pfid }));
        }
Exemplo n.º 2
0
        public void AddPermissaoPerfil(VinculoPerfilPermissaoViewModel vinculo)
        {
            using (NimbusAcad_DB_Entities db = new NimbusAcad_DB_Entities())
            {
                RBAC_Link_Perfil_Permissao linkPP = new RBAC_Link_Perfil_Permissao();
                linkPP.Perfil_ID    = vinculo.PerfilID;
                linkPP.Permissao_ID = vinculo.PermissaoID;

                db.RBAC_Link_Perfil_Permissao.Add(linkPP);
                db.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public ActionResult RemoverPermissao(int?pfid, int?pmid)
        {
            if (pfid == null || pmid == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RBAC_Link_Perfil_Permissao lpp = db.RBAC_Link_Perfil_Permissao.Where(o => o.Perfil_ID == pfid && o.Permissao_ID == pmid).FirstOrDefault();

            if (lpp == null)
            {
                return(HttpNotFound());
            }
            return(View(lpp));
        }
Exemplo n.º 4
0
 public ActionResult VincularPermissao([Bind(Include = "PerfilID, PermissaoID")] VinculoPerfilPermissaoViewModel VPPVM)
 {
     if (ModelState.IsValid)
     {
         RBAC_Link_Perfil_Permissao lpp = new RBAC_Link_Perfil_Permissao();
         lpp.Perfil_ID    = VPPVM.PerfilID;
         lpp.Permissao_ID = VPPVM.PermissaoID;
         db.RBAC_Link_Perfil_Permissao.Add(lpp);
         db.SaveChanges();
         return(RedirectToAction("Detalhes", new { id = VPPVM.PerfilID }));
     }
     PopulatePermissaoDropDownList(VPPVM.PermissaoID);
     return(View(VPPVM));
 }