Exemple #1
0
        private Permissao CancelarProjeto()
        {
            Permissao DeletarP = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "CancelarProjeto"));

            if (DeletarP == null)
            {
                DeletarP      = ObjectSpace.CreateObject <Permissao>();
                DeletarP.Name = "CancelarProjeto";
            }
            DeletarP.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            DeletarP.AddTypePermissionsRecursively <Projeto>("Delete", SecurityPermissionState.Allow);
            DeletarP.Save();
            return(DeletarP);
        }
Exemple #2
0
        private Permissao ConfigurarSistema()
        {
            Permissao config = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "ConfigurarSistema"));

            if (config == null)
            {
                config      = ObjectSpace.CreateObject <Permissao>();
                config.Name = "ConfigurarSistema";
            }
            config.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            config.AddTypePermissionsRecursively <Configuracao>("Write;Read", SecurityPermissionState.Allow);
            config.AddNavigationPermission(@"Application/NavigationItems/Items/Configurações/Items/Configuracao_ListView", SecurityPermissionState.Allow);
            config.Save();
            return(config);
        }
Exemple #3
0
        private Permissao Testar()
        {
            Permissao testar = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "Testar"));

            if (testar == null)
            {
                testar      = ObjectSpace.CreateObject <Permissao>();
                testar.Name = "Testar";
            }
            testar.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            testar.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            testar.AddTypePermissionsRecursively <SubTarefa>("Write;Read", SecurityPermissionState.Allow);
            testar.AddTypePermissionsRecursively <TempoTarefa>("Read", SecurityPermissionState.Allow);
            testar.Save();
            return(testar);
        }
Exemple #4
0
        private Permissao Desenvolver()
        {
            Permissao desenvolv = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "Desenvolver"));

            if (desenvolv == null)
            {
                desenvolv      = ObjectSpace.CreateObject <Permissao>();
                desenvolv.Name = "Desenvolver";
            }
            desenvolv.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            desenvolv.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            desenvolv.AddTypePermissionsRecursively <SubTarefa>("Write;Read", SecurityPermissionState.Allow);
            desenvolv.AddTypePermissionsRecursively <TempoTarefa>("Read", SecurityPermissionState.Allow);
            desenvolv.Save();
            return(desenvolv);
        }
Exemple #5
0
        private Permissao EditarHorario()
        {
            Permissao edHorario = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "EditarHorario"));

            if (edHorario == null)
            {
                edHorario      = ObjectSpace.CreateObject <Permissao>();
                edHorario.Name = "EditarHorario";
            }
            edHorario.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            edHorario.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            edHorario.AddTypePermissionsRecursively <SubTarefa>("Write;Read", SecurityPermissionState.Allow);
            edHorario.AddTypePermissionsRecursively <TempoTarefa>("Write;Read", SecurityPermissionState.Allow);
            edHorario.Save();
            return(edHorario);
        }
Exemple #6
0
        private Permissao CadastrarPerfil()
        {
            Permissao cadPerfil = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "CadastrarPerfil"));

            if (cadPerfil == null)
            {
                cadPerfil      = ObjectSpace.CreateObject <Permissao>();
                cadPerfil.Name = "CadastrarPerfil";
            }
            cadPerfil.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            cadPerfil.AddTypePermissionsRecursively <PerfilUsuario>("Create;Write;Read;Delete", SecurityPermissionState.Allow);
            cadPerfil.AddNavigationPermission(@"Application/NavigationItems/Items/Usuários e Permissões/Items/PerfilUsuario_ListView", SecurityPermissionState.Allow);
            cadPerfil.AddNavigationPermission(@"Application/NavigationItems/Items/Usuários e Permissões/Items/Usuario_ListView", SecurityPermissionState.Allow);
            cadPerfil.Save();
            return(cadPerfil);
        }
Exemple #7
0
        private Permissao Analisar()
        {
            Permissao analiza = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "Analisar"));

            if (analiza == null)
            {
                analiza      = ObjectSpace.CreateObject <Permissao>();
                analiza.Name = "Analisar";
            }
            analiza.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            analiza.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            analiza.AddTypePermissionsRecursively <SubTarefa>("Write;Read", SecurityPermissionState.Allow);
            analiza.AddTypePermissionsRecursively <TempoTarefa>("Read", SecurityPermissionState.Allow);

            analiza.Save();
            return(analiza);
        }
Exemple #8
0
        private Permissao Versionar()
        {
            Permissao vers = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "Versionar"));

            if (vers == null)
            {
                vers      = ObjectSpace.CreateObject <Permissao>();
                vers.Name = "Versionar";
            }
            vers.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            vers.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            vers.AddTypePermissionsRecursively <Versao>("Create;Read", SecurityPermissionState.Allow);

            vers.AddNavigationPermission(@"Application/NavigationItems/Items/Tarefas/Items/Versao_DetailView", SecurityPermissionState.Allow);
            vers.Save();
            return(vers);
        }
Exemple #9
0
        private Permissao Relatorios()
        {
            Permissao relatorio = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "Relatorios"));

            if (relatorio == null)
            {
                relatorio      = ObjectSpace.CreateObject <Permissao>();
                relatorio.Name = "Relatorios";
            }
            relatorio.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            relatorio.AddTypePermissionsRecursively <Projeto>("Read", SecurityPermissionState.Allow);
            relatorio.AddTypePermissionsRecursively <Tarefa>("Read", SecurityPermissionState.Allow);
            relatorio.AddTypePermissionsRecursively <SubTarefa>("Read", SecurityPermissionState.Allow);
            relatorio.AddTypePermissionsRecursively <Usuario>("Read", SecurityPermissionState.Allow);
            relatorio.AddTypePermissionsRecursively <Versao>("Read", SecurityPermissionState.Allow);
            relatorio.AddNavigationPermission(@"Application/NavigationItems/Items/Relatórios", SecurityPermissionState.Allow);
            relatorio.Save();
            return(relatorio);
        }
Exemple #10
0
        private Permissao ReceberTarefas()
        {
            Permissao receberTarefas = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "ReceberTarefas"));

            if (receberTarefas == null)
            {
                receberTarefas      = ObjectSpace.CreateObject <Permissao>();
                receberTarefas.Name = "ReceberTarefas";
            }
            receberTarefas.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            receberTarefas.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            receberTarefas.AddTypePermissionsRecursively <SubTarefa>("Write;Read", SecurityPermissionState.Allow);
            receberTarefas.AddTypePermissionsRecursively <Usuario>("Read", SecurityPermissionState.Allow);
            receberTarefas.AddTypePermissionsRecursively <Versao>("Read", SecurityPermissionState.Allow);

            receberTarefas.AddNavigationPermission(@"Application/NavigationItems/Items/Tarefas/Items/Tarefa_ListView", SecurityPermissionState.Allow);
            receberTarefas.Save();
            return(receberTarefas);
        }
Exemple #11
0
        private Permissao ConsultarProjeto()
        {
            Permissao ConsultarP = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "ConsultarProjeto"));

            if (ConsultarP == null)
            {
                ConsultarP      = ObjectSpace.CreateObject <Permissao>();
                ConsultarP.Name = "ConsultarProjeto";
            }
            ConsultarP.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            ConsultarP.AddTypePermissionsRecursively <Projeto>("Read", SecurityPermissionState.Allow);
            ConsultarP.AddTypePermissionsRecursively <Tarefa>("Read", SecurityPermissionState.Allow);
            ConsultarP.AddTypePermissionsRecursively <SubTarefa>("Read", SecurityPermissionState.Allow);
            ConsultarP.AddTypePermissionsRecursively <Versao>("Read", SecurityPermissionState.Allow);
            ConsultarP.AddTypePermissionsRecursively <Usuario>("Read", SecurityPermissionState.Allow);
            ConsultarP.AddNavigationPermission(@"Application/NavigationItems/Items/Projetos/Items/ConsultaProjeto_ListView", SecurityPermissionState.Allow);

            ConsultarP.Save();
            return(ConsultarP);
        }
Exemple #12
0
        //private Permissao ConsultarTarefa()
        //{
        //    Permissao consultarT = ObjectSpace.FindObject<Permissao>(new BinaryOperator("Name", "ConsultarTarefa"));
        //    if (consultarT == null)
        //    {
        //        consultarT = ObjectSpace.CreateObject<Permissao>();
        //        consultarT.Name = "ConsultarTarefa";
        //    }
        //    consultarT.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
        //    consultarT.Save();
        //    return consultarT;
        //}

        private Permissao DefinirResponsavel()
        {
            Permissao DefResp = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "DefinirResponsavel"));

            if (DefResp == null)
            {
                DefResp      = ObjectSpace.CreateObject <Permissao>();
                DefResp.Name = "DefinirResponsavel";
            }
            DefResp.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            DefResp.AddTypePermissionsRecursively <Tarefa>("Write;Read", SecurityPermissionState.Allow);
            DefResp.AddTypePermissionsRecursively <SubTarefa>("Write;Read", SecurityPermissionState.Allow);
            DefResp.AddTypePermissionsRecursively <Usuario>("Read", SecurityPermissionState.Allow);
            DefResp.AddTypePermissionsRecursively <Versao>("Read", SecurityPermissionState.Allow);
            DefResp.AddTypePermissionsRecursively <Projeto>("Read", SecurityPermissionState.Allow);


            DefResp.AddNavigationPermission(@"Application/NavigationItems/Items/Tarefas/Items/ConsultarTarefa_ListView", SecurityPermissionState.Allow);
            DefResp.Save();
            return(DefResp);
        }
Exemple #13
0
        private Permissao CadastrarTarefa()
        {
            Permissao CadTarefa = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "CadastrarTarefa"));

            if (CadTarefa == null)
            {
                CadTarefa      = ObjectSpace.CreateObject <Permissao>();
                CadTarefa.Name = "CadastrarTarefa";
            }
            CadTarefa.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            CadTarefa.AddTypePermissionsRecursively <Tarefa>("Create;Write;Read;Delete", SecurityPermissionState.Allow);
            CadTarefa.AddTypePermissionsRecursively <SubTarefa>("Create;Write;Read;Delete", SecurityPermissionState.Allow);
            CadTarefa.AddTypePermissionsRecursively <Versao>("Read", SecurityPermissionState.Allow);
            CadTarefa.AddTypePermissionsRecursively <Usuario>("Read", SecurityPermissionState.Allow);

            CadTarefa.AddNavigationPermission(@"Application/NavigationItems/Items/Tarefas/Items/ConsultarTarefa_ListView", SecurityPermissionState.Allow);
            CadTarefa.AddNavigationPermission(@"Application/NavigationItems/Items/Tarefas/Items/CriarTarefa_DetailView", SecurityPermissionState.Allow);
            CadTarefa.AddNavigationPermission(@"Application/NavigationItems/Items/Tarefas/Items/Criar SubTarefa", SecurityPermissionState.Allow);
            CadTarefa.Save();
            return(CadTarefa);
        }
Exemple #14
0
        //-------------------------//
        #region Permissões de Acesso ao Sistema

        private Permissao CadastrarProjeto()
        {
            Permissao CadProjRole = ObjectSpace.FindObject <Permissao>(new BinaryOperator("Name", "CadastrarProjeto"));

            if (CadProjRole == null)
            {
                CadProjRole      = ObjectSpace.CreateObject <Permissao>();
                CadProjRole.Name = "CadastrarProjeto";
                CadProjRole.AddObjectPermission <PermissionPolicyUser>(SecurityOperations.Read, "[Oid] = CurrentUserId()", SecurityPermissionState.Allow);
            }
            CadProjRole.PermissionPolicy = SecurityPermissionPolicy.DenyAllByDefault;
            CadProjRole.AddTypePermissionsRecursively <Projeto>("Create;Write;Read", SecurityPermissionState.Allow);
            CadProjRole.AddTypePermissionsRecursively <Tarefa>("Read", SecurityPermissionState.Allow);
            CadProjRole.AddTypePermissionsRecursively <SubTarefa>("Read", SecurityPermissionState.Allow);
            CadProjRole.AddTypePermissionsRecursively <Versao>("Read", SecurityPermissionState.Allow);
            CadProjRole.AddTypePermissionsRecursively <Usuario>("Read", SecurityPermissionState.Allow);

            CadProjRole.AddNavigationPermission(@"Application/NavigationItems/Items/Projetos/Items/Projeto_ListView", SecurityPermissionState.Allow);
            CadProjRole.AddNavigationPermission(@"Application/NavigationItems/Items/Projetos/Items/CriarProjeto_DetailView", SecurityPermissionState.Allow);
            CadProjRole.Save();
            return(CadProjRole);
        }