Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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);
        }
Esempio n. 7
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);
        }
Esempio n. 8
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);
        }
Esempio n. 9
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);
        }