Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSetAllowedToDefaultValueAndRunningWorksForUDF() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSetAllowedToDefaultValueAndRunningWorksForUDF()
        {
            ConfiguredSetup(stringMap(SecuritySettings.default_allowed.name(), "role1"));

            UserManager.newRole("role1", "noneSubject");
            AssertSuccess(Neo.login("noneSubject", "abc"), "RETURN test.allowedFunc() AS c", itr => assertKeyIs(itr, "c", "success for role1"));
        }
Exemplo n.º 2
0
        private void init_NN_Centroids()
        {
            int count = 0;

            for (int i = 0; i < num; i++)
            {
                if (count == 14)
                {
                    count = 0;
                }
                neoron n = new neoron();
                n.Centroid = featers[count];
                count++;
                Neo.Add(n);
            }

            for (int j = 0; j < Num_classes; j++)
            {
                Output op = new Output();
                outputs.Add(op);
            }

            for (int x = 0; x < Weight.Length; x++)
            {
                Random rand = new Random();
                Weight[x] = rand.Next(1, 100);
            }
        }
Exemplo n.º 3
0
        public MessageBox(Neo neo, string message, Result[] resultButtons) : base(neo, true)
        {
            WantsMouse         = true;
            _buttonRow         = new Row(neo);
            _buttonRow.Anchors = Anchors.Bottom | Anchors.Left | Anchors.Right;

            _buttonRow.LayoutRule = Row.LayoutRules.RightToLeft;
            _buttonRow.Margins    = new Margins(15);
            _buttonRow.Size       = new Size(50);

            Label _label = new Label(neo, message);

            _label.Anchors = Anchors.Left | Anchors.Top;
            _label.Margins = new Margins(20);

            foreach (Result r in resultButtons)
            {
                ResultButton _btn = new ResultButton(neo, r);
                _btn.Size = new Size(27 + 10 * r.ToString().Length, 38);
                //_btn.Anchors = Anchors.Bottom;
                _btn.Color    = Color.Aqua;
                _btn.Margins  = new Margins(5, 0, 5, 0);
                _btn.Clicked += btnClicked;
                _buttonRow.AddChild(_btn);
            }

            AddChild(_label);
            AddChild(_buttonRow);
        }
Exemplo n.º 4
0
        public IActionResult NeoPage(int Id)
        {
            Neo Neo = _context.Neos.Where(n => n.Id == Id)
                      .Include(n => n.Completers)
                      .ThenInclude(c => c.Employee)
                      .SingleOrDefault();

            ViewBag.Neo = Neo;

            // Puts all people invited into a list
            List <Employee> Completers = new List <Employee>();

            for (int i = 0; i < Neo.Completers.Count; i++)
            {
                Completers.Add(_context.Employees.Where(e => e.Id == Neo.Completers[i].EmployeeId).SingleOrDefault());
            }

            // Gets list of people not invited -- Could probably do this with the list of compelters taken from Neo object.
            List <Employee> NotInvited = _context.Employees.OrderBy(e => e.FirstName)
                                         .ToList();

            foreach (Employee EE in Completers)
            {
                if (NotInvited.Contains(EE))
                {
                    NotInvited.Remove(EE);
                }
            }
            ViewBag.NotInvited = NotInvited;
            ViewBag.Admin      = CheckAdmin();
            return(View());
        }
Exemplo n.º 5
0
        //---------- User deletion -----------

        /*
         * Admin creates user Henrik with password bar
         * Admin deletes user Henrik
         * Henrik logs in with correct password → fail
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void userDeletion1() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UserDeletion1()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.deleteUser('Henrik')");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertInitFailed(subject);
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void loginShouldFailWithIncorrectPassword() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void LoginShouldFailWithIncorrectPassword()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', true)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "foo");

            Neo.assertInitFailed(subject);
        }
Exemplo n.º 7
0
 public static Neo getNeo()
 {
     if (neo == null)
     {
         neo = new Neo();
     }
     return(neo);
 }
Exemplo n.º 8
0
 public MessageBox(Neo neo, string message, Action <Result> method,
                   Result result1,
                   Result result2) : this(
         neo, message,
         new Result[] { result1, result2 })
 {
     _method = method;
 }
Exemplo n.º 9
0
        public IActionResult updateIncompletes(int incompletes, int NeoId)
        {
            Neo Neo = _context.Neos.Where(n => n.Id == NeoId).SingleOrDefault();

            Neo.Incompletes = incompletes;
            _context.SaveChanges();
            return(RedirectToAction("NeoPage", new { Id = NeoId }));
        }
Exemplo n.º 10
0
        public IActionResult updateNoShows(int noShows, int NeoId)
        {
            Neo Neo = _context.Neos.Where(n => n.Id == NeoId).SingleOrDefault();

            Neo.NoShows = noShows;
            _context.SaveChanges();
            return(RedirectToAction("NeoPage", new { Id = NeoId }));
        }
Exemplo n.º 11
0
        public IActionResult Delete(int Id)
        {
            Neo Neo = _context.Neos.Where(n => n.Id == Id).SingleOrDefault();

            _context.Neos.Remove(Neo);
            _context.SaveChanges();
            return(RedirectToAction("showNeos"));
        }
Exemplo n.º 12
0
        /*
         * Admin creates user Henrik with password bar
         * Admin adds user Henrik to role Publisher
         * Henrik logs in with correct password
         * Henrik creates user Craig → permission denied
         * Henrik logs off
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void userCreation5() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UserCreation5()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + PUBLISHER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "bar");

            TestFailCreateUser(subject, PERMISSION_DENIED);
        }
Exemplo n.º 13
0
        //---------- User creation -----------

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void readOperationsShouldNotBeAllowedWhenPasswordChangeRequired() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ReadOperationsShouldNotBeAllowedWhenPasswordChangeRequired()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', true)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertPasswordChangeRequired(subject);
            TestFailRead(subject, 3, PwdReqErrMsg(ReadOpsNotAllowed));
        }
Exemplo n.º 14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleWriteAfterAllowedReadProcedureWithAuthDisabled() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleWriteAfterAllowedReadProcedureWithAuthDisabled()
        {
            Neo = setUpNeoServer(stringMap(GraphDatabaseSettings.auth_enabled.name(), "false"));

            Neo.LocalGraph.DependencyResolver.resolveDependency(typeof(Procedures)).registerProcedure(typeof(ClassWithProcedures));

            S subject = Neo.login("no_auth", "");

            AssertEmpty(subject, "CALL test.allowedReadProcedure() YIELD value CREATE (:NewNode {name: value})");
        }
Exemplo n.º 15
0
        public async Task StartAsync(IDialogContext context)
        {
            Idiom.Loadwords();
            Neo.Loadwords();
            Initial.Loadwords();

            await context.PostAsync(strWelcomMMessage);

            context.Wait(MessageReceivedAsync);
        }
Exemplo n.º 16
0
        /*
         * Admin creates user Henrik with password abc
         * Admin creates user Craig
         * Admin adds user Henrik to role Reader
         * Henrik logs in with password abc → ok
         * Henrik starts transaction with read query → ok
         * Henrik changes Craig’s password to 123 → fail
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void changeUserPassword3() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ChangeUserPassword3()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Craig', 'abc', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'abc', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "abc");

            Neo.assertAuthenticated(subject);
            TestSuccessfulRead(subject, 3);
            AssertFail(subject, "CALL dbms.security.changeUserPassword('Craig', '123')", PERMISSION_DENIED);
        }
Exemplo n.º 17
0
        /*
         * Admin creates user Henrik with password bar
         * Henrik logs in with correct password → ok
         * Henrik lists all roles → permission denied
         * Admin lists all roles → ok
         * Admin adds user Henrik to role Admin
         * Henrik lists all roles → ok
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void rolesListing() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void RolesListing()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertAuthenticated(subject);
            TestFailListRoles(subject, PERMISSION_DENIED);
            TestSuccessfulListRoles(AdminSubject, InitialRoles);
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + ADMIN + "', 'Henrik')");
            TestSuccessfulListRoles(subject, InitialRoles);
        }
Exemplo n.º 18
0
        /*
         * Admin creates user Henrik with password bar
         * Henrik logs in with correct password
         * Henrik starts transaction with write query → permission denied
         * Admin adds user Henrik to role Publisher → ok
         * Admin adds user Henrik to role Publisher → ok
         * Henrik starts transaction with write query → ok
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void roleManagement2() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void RoleManagement2()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertAuthenticated(subject);
            TestFailWrite(subject);
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + PUBLISHER + "', 'Henrik')");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + PUBLISHER + "', 'Henrik')");
            TestSuccessfulWrite(subject);
        }
Exemplo n.º 19
0
        //---------- User activation -----------

        /*
         * Admin creates user Henrik with password bar
         * Admin suspends user Henrik
         * Henrik logs in with correct password → fail
         * Admin reinstates user Henrik
         * Henrik logs in with correct password → ok
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void userActivation1() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UserActivation1()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.suspendUser('Henrik')");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertInitFailed(subject);
            AssertEmpty(AdminSubject, "CALL dbms.security.activateUser('Henrik', false)");
            subject = Neo.login("Henrik", "bar");
            Neo.assertAuthenticated(subject);
        }
Exemplo n.º 20
0
 /* Utilizar este evento da coluna customizavel do datagrid para implementar
  * a logica para definir as cores da celular.
  */
 protected void colData_OnDrawColumnCell(object sender, Neo.Pocket.Controls.NeoDataGridCustomColumnEventArgs e)
 {
     if (DateTime.Parse(e.Column.Text) < DateTime.Now)
     {
         e.Column.ForeColor = Color.Red;
     }
     else
     {
         e.Column.ForeColor = Color.Black;
     }
 }
Exemplo n.º 21
0
        /*
         * Admin creates user Henrik with password bar
         * Admin creates user Craig
         * Admin adds user Henrik to role Publisher
         * Admin adds user Craig to role Publisher
         * Henrik logs in with correct password → ok
         * Henrik lists all users for role Publisher → permission denied
         * Admin lists all users for role Publisher → ok
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void listingRoleUsers() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ListingRoleUsers()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Craig', 'foo', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + PUBLISHER + "', 'Craig')");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + PUBLISHER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertAuthenticated(subject);
            TestFailListRoleUsers(subject, PUBLISHER, PERMISSION_DENIED);
            AssertSuccess(AdminSubject, "CALL dbms.security.listUsersForRole('" + PUBLISHER + "') YIELD value as users RETURN users", r => assertKeyIs(r, "users", "Henrik", "Craig", "writeSubject"));
        }
Exemplo n.º 22
0
        /*
         * Admin creates user Henrik with password bar
         * Admin adds user Henrik to role Publisher
         * User Henrik logs in with correct password → ok
         * Admin deletes user Henrik
         * Henrik starts transaction with read query → fail
         * Henrik tries to login again → fail
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void userDeletion4() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UserDeletion4()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + PUBLISHER + "', 'Henrik')");
            S henrik = Neo.login("Henrik", "bar");

            Neo.assertAuthenticated(henrik);
            AssertEmpty(AdminSubject, "CALL dbms.security.deleteUser('Henrik')");
            Neo.assertSessionKilled(henrik);
            henrik = Neo.login("Henrik", "bar");
            Neo.assertInitFailed(henrik);
        }
Exemplo n.º 23
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void passwordChangeShouldEnableRolePermissions() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void PasswordChangeShouldEnableRolePermissions()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', true)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertPasswordChangeRequired(subject);
            AssertPasswordChangeWhenPasswordChangeRequired(subject, "foo");
            subject = Neo.login("Henrik", "foo");
            Neo.assertAuthenticated(subject);
            TestFailWrite(subject);
            TestSuccessfulRead(subject, 3);
        }
Exemplo n.º 24
0
        private void UpdatePriceList(string tierType, string itemName, int price)
        {
            if (tierType == "Lith")
            {
                Lith tempLith = new Lith();
                tempLith.Item  = itemName;
                tempLith.Price = price;
                if (!dumpList.Contains(itemName))
                {
                    Console.WriteLine(AppManager.priceWindow.LithGridList.Items.Contains(itemName));
                    AppManager.priceWindow.LithGridList.Items.Add(tempLith);
                    dumpList.Add(itemName);
                }
            }

            if (tierType == "Meso")
            {
                Meso tempMeso = new Meso();
                tempMeso.Item  = itemName;
                tempMeso.Price = price;
                if (!dumpList.Contains(itemName))
                {
                    AppManager.priceWindow.MesoGridList.Items.Add(tempMeso);
                    dumpList.Add(itemName);
                }
            }

            if (tierType == "Neo")
            {
                Neo tempNeo = new Neo();
                tempNeo.Item  = itemName;
                tempNeo.Price = price;
                if (!dumpList.Contains(itemName))
                {
                    AppManager.priceWindow.NeoGridList.Items.Add(tempNeo);
                    dumpList.Add(itemName);
                }
            }

            if (tierType == "Axi")
            {
                Axi tempAxi = new Axi();
                tempAxi.Item  = itemName;
                tempAxi.Price = price;
                if (!dumpList.Contains(itemName))
                {
                    AppManager.priceWindow.AxiGridList.Items.Add(tempAxi);
                    dumpList.Add(itemName);
                }
            }
        }
Exemplo n.º 25
0
        public void TestMethod1()
        {
            IMatrixHuman neo     = new Neo();
            IRedPill     redPill = new RedPill();

            try
            {
                neo.Swallow(redPill);
            }
            catch (RedPillException ex)
            {
                Assert.IsTrue(ex.Location.Vector.X == 10 && ex.Location.Vector.Y == 11 && ex.Location.Vector.Z == 12);
            }
        }
Exemplo n.º 26
0
        /*
         * Admin creates user Henrik with password bar
         * Admin adds user Henrik to role Reader
         * Henrik logs in with correct password → ok
         * Henrik starts and completes transaction with read query → ok
         * Admin suspends user Henrik
         * Henrik’s session is terminated
         * Henrik logs in with correct password → fail
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void userSuspension2() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UserSuspension2()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertAuthenticated(subject);
            TestSuccessfulRead(subject, 3);
            AssertEmpty(AdminSubject, "CALL dbms.security.suspendUser('Henrik')");

            Neo.assertSessionKilled(subject);

            subject = Neo.login("Henrik", "bar");
            Neo.assertInitFailed(subject);
        }
Exemplo n.º 27
0
        public Control(Neo neo, bool CanHaveChildren)
        {
            _neo = neo;

            if (CanHaveChildren)
            {
                _children = new List <Control>();
            }
            else
            {
                _children = new List <Control>(0);
            }

            Size = new Size(10, 10);
        }
Exemplo n.º 28
0
        /*
         * Admin creates user Henrik with password abc
         * Admin adds user Henrik to role Reader
         * Henrik logs in with password abc → ok
         * Henrik starts transaction with read query → ok
         * Admin changes user Henrik’s password to 123
         * Henrik logs out
         * Henrik logs in with password abc → fail
         * Henrik logs in with password 123 → ok
         * Henrik starts transaction with read query → ok
         * Henrik logs out
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void changeUserPassword2() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ChangeUserPassword2()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'abc', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "abc");

            Neo.assertAuthenticated(subject);
            TestSuccessfulRead(subject, 3);
            AssertEmpty(AdminSubject, "CALL dbms.security.changeUserPassword('Henrik', '123', false)");
            Neo.logout(subject);
            subject = Neo.login("Henrik", "abc");
            Neo.assertInitFailed(subject);
            subject = Neo.login("Henrik", "123");
            Neo.assertAuthenticated(subject);
            TestSuccessfulRead(subject, 3);
        }
Exemplo n.º 29
0
        /*
         * Admin creates user Henrik with password bar
         * Henrik logs in with correct password
         * Henrik starts read transaction → permission denied
         * Henrik starts write transaction → permission denied
         * Henrik starts schema transaction → permission denied
         * Henrik creates user Craig → permission denied
         * Admin adds user Henrik to role Architect
         * Henrik starts write transaction → ok
         * Henrik starts read transaction → ok
         * Henrik starts schema transaction → ok
         * Henrik creates user Craig → permission denied
         * Henrik logs off
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void userCreation4() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void UserCreation4()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'bar', false)");
            S subject = Neo.login("Henrik", "bar");

            Neo.assertAuthenticated(subject);
            TestFailRead(subject, 3);
            TestFailWrite(subject);
            TestFailSchema(subject);
            TestFailCreateUser(subject, PERMISSION_DENIED);
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + ARCHITECT + "', 'Henrik')");
            TestSuccessfulWrite(subject);
            TestSuccessfulRead(subject, 4);
            TestSuccessfulSchema(subject);
            TestFailCreateUser(subject, PERMISSION_DENIED);
        }
Exemplo n.º 30
0
        //---------- change password -----------

        /*
         * Admin creates user Henrik with password abc
         * Admin adds user Henrik to role Reader
         * Henrik logs in with correct password → ok
         * Henrik starts transaction with read query → ok
         * Henrik changes password to 123
         * Henrik starts transaction with read query → ok
         * Henrik logs out
         * Henrik logs in with password abc → fail
         * Henrik logs in with password 123 → ok
         * Henrik starts transaction with read query → ok
         * Henrik logs out
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void changeUserPassword1() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ChangeUserPassword1()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('Henrik', 'abc', false)");
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('" + READER + "', 'Henrik')");
            S subject = Neo.login("Henrik", "abc");

            Neo.assertAuthenticated(subject);
            TestSuccessfulRead(subject, 3);
            AssertEmpty(subject, "CALL dbms.security.changeUserPassword('Henrik', '123', false)");
            Neo.updateAuthToken(subject, "Henrik", "123");                 // Because RESTSubject caches an auth token that is sent with every request
            TestSuccessfulRead(subject, 3);
            Neo.logout(subject);
            subject = Neo.login("Henrik", "abc");
            Neo.assertInitFailed(subject);
            subject = Neo.login("Henrik", "123");
            Neo.assertAuthenticated(subject);
            TestSuccessfulRead(subject, 3);
        }
Exemplo n.º 31
0
        /*
         * Procedure 'test.allowedReadProcedure' with READ mode and 'allowed = role1' is loaded.
         * Procedure 'test.allowedWriteProcedure' with WRITE mode and 'allowed = role1' is loaded.
         * Procedure 'test.allowedSchemaProcedure' with SCHEMA mode and 'allowed = role1' is loaded.
         * Admin creates a new user 'mats'.
         * 'mats' logs in.
         * 'mats' executes the procedures, access denied.
         * Admin creates 'role1'.
         * 'mats' executes the procedures, access denied.
         * Admin adds role 'role1' to 'mats'.
         * 'mats' executes the procedures successfully.
         * Admin removes the role 'role1'.
         * 'mats' executes the procedures, access denied.
         * Admin creates the role 'role1' again (new).
         * 'mats' executes the procedures, access denied.
         * Admin adds role 'architect' to 'mats'.
         * 'mats' executes the procedures successfully.
         * Admin adds 'role1' to 'mats'.
         * 'mats' executes the procedures successfully.
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void customRoleWithProcedureAccess() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CustomRoleWithProcedureAccess()
        {
            AssertEmpty(AdminSubject, "CALL dbms.security.createUser('mats', 'neo4j', false)");
            S mats = Neo.login("mats", "neo4j");

            TestFailTestProcs(mats);
            AssertEmpty(AdminSubject, "CALL dbms.security.createRole('role1')");
            TestFailTestProcs(mats);
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('role1', 'mats')");
            TestSuccessfulTestProcs(mats);
            AssertEmpty(AdminSubject, "CALL dbms.security.deleteRole('role1')");
            TestFailTestProcs(mats);
            AssertEmpty(AdminSubject, "CALL dbms.security.createRole('role1')");
            TestFailTestProcs(mats);
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('architect', 'mats')");
            TestSuccessfulTestProcs(mats);
            AssertEmpty(AdminSubject, "CALL dbms.security.addRoleToUser('role1', 'mats')");
            TestSuccessfulTestProcs(mats);
        }
Exemplo n.º 32
0
        void colEstoque_OnDrawColumnCell(object sender, Neo.Pocket.Controls.NeoDataGridCustomColumnEventArgs e)
        {
            /*

            Int32? estoque = null;

            try
            {
                estoque = Int32.Parse(e.Column.Text);
            }
            catch { }

            if (estoque != null)
            {
                if (estoque < 10)
                    e.Column.BackColor = Color.Yellow;
                else if (estoque == 0)
                    e.Column.BackColor = Color.Red;
            }
             */
        }
Exemplo n.º 33
0
 public Neo.ApplicationFramework.Interfaces.VariantValue aaaa(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = (int)Globals.Tags.InletPressIndicator.Value == 1 ? "Inlet Pressure" : "Test Pressure";
 }
 void AnalogNumeric1_ValueChanged(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
 {
     Neo.ApplicationFramework.Common.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetBacklightTimout((int)Globals.Tags.ScreenSaverTimeout.Value);
 }
Exemplo n.º 35
0
 internal Address(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext)
     : base(aRow, aContext)
 {
     CustomerMailingAddress = new ObjectRelation<Customer>(this, "CustomerMailingAddress");
     CustomerDeliveryAddress = new ObjectRelation<Customer>(this, "CustomerDeliveryAddress");
 }
Exemplo n.º 36
0
 internal Customer(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext)
     : base(aRow, aContext)
 {
     Orders = new ObjectRelation<Order>(this, "Orders");
 }
Exemplo n.º 37
0
 public Neo.ApplicationFramework.Interfaces.VariantValue FahrenheitToCelsius(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return (value-32)*5F/9F;
 }
Exemplo n.º 38
0
 public Neo.ApplicationFramework.Interfaces.VariantValue diagpic1(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = Globals.Tags.DiagStage.Value > 0 ? 1 : 0;;
 }
Exemplo n.º 39
0
 public Neo.ApplicationFramework.Interfaces.VariantValue ddd(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value;
 }
Exemplo n.º 40
0
 public Neo.ApplicationFramework.Interfaces.VariantValue Log(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return System.Math.Sqrt(value);
 }
Exemplo n.º 41
0
 internal Product(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext)
     : base(aRow, aContext)
 {
     Inventory = new ObjectRelation<Inventory>(this, "Inventory");
     OrderItems = new ObjectRelation<OrderItem>(this, "OrderItems");
 }
Exemplo n.º 42
0
 internal Inventory(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext)
     : base(aRow, aContext)
 {
 }
Exemplo n.º 43
0
 internal Status(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext)
     : base(aRow, aContext)
 {
     Customers = new ObjectRelation<Customer>(this, "Customers");
 }
Exemplo n.º 44
0
 public Neo.ApplicationFramework.Interfaces.VariantValue AddText(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return "FIRMWARE" + value;
 }
Exemplo n.º 45
0
 public Neo.ApplicationFramework.Interfaces.VariantValue lowerLimit(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = 0.01;
 }
Exemplo n.º 46
0
 public Neo.ApplicationFramework.Interfaces.VariantValue CelsiusToFahrenheit(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return (value*(9F/5F))+32;
 }
Exemplo n.º 47
0
 public Neo.ApplicationFramework.Interfaces.VariantValue low_limit(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = (double)Globals.Tags.Stab_low_green.Value + 0.01;
 }
Exemplo n.º 48
0
 public Neo.ApplicationFramework.Interfaces.VariantValue diaggif3(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = Globals.Tags.DiagProgress.Value >= 26 && Globals.Tags.DiagProgress.Value <= 31 ? 1 : 0;;
 }
Exemplo n.º 49
0
 public Neo.ApplicationFramework.Interfaces.VariantValue MaximumFontSize(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = (Globals.Tags.BackFlowIndicator.Value == 1) || (Globals.Tags.MainUnderRangeEnable.Value == 1) ? 26 : 38;;
 }
Exemplo n.º 50
0
 public Neo.ApplicationFramework.Interfaces.VariantValue diagpic3(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = Globals.Tags.DiagProgress.Value >= 32 ? 1 : 0;
 }
Exemplo n.º 51
0
 public Neo.ApplicationFramework.Interfaces.VariantValue upperlimit(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = 99.96;
 }
Exemplo n.º 52
0
 public Neo.ApplicationFramework.Interfaces.VariantValue firmware(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = "FIRMWARE " + Globals.Tags.firmware.Value;
 }
Exemplo n.º 53
0
 public Neo.ApplicationFramework.Interfaces.VariantValue usbstatuscheck(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = Globals.Tags.USBStatus.Value == 1 ? "USB ON" : "USB OFF";
 }
Exemplo n.º 54
0
 internal OrderItem(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext)
     : base(aRow, aContext)
 {
 }
Exemplo n.º 55
0
 public Neo.ApplicationFramework.Interfaces.VariantValue aaa(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value = "SERIAL#" + Globals.Tags.serial.Value;
 }
Exemplo n.º 56
0
 public Neo.ApplicationFramework.Interfaces.VariantValue GetPressDecimal(Neo.ApplicationFramework.Interfaces.VariantValue value)
 {
     return value;
 }
Exemplo n.º 57
0
 protected void OnDrawColumnCell(object sender, Neo.Pocket.Controls.NeoDataGridCustomColumnEventArgs e)
 {
     CheckRowColor(e.Column);
 }