コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionAuthDisabledAndRestricted()
        public virtual void ShouldMakeNiceDescriptionAuthDisabledAndRestricted()
        {
            SecurityContext disabled   = SecurityContext.AUTH_DISABLED;
            SecurityContext restricted = disabled.WithMode(new RestrictedAccessMode(disabled.Mode(), [email protected]_Static.Read));

            assertThat(restricted.Description(), equalTo("AUTH_DISABLED with FULL restricted to READ"));
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            _manager = new BasicAuthManager(new InMemoryUserRepository(), new BasicPasswordPolicy(), Clocks.systemClock(), new InMemoryUserRepository(), Config.defaults());
            _manager.init();
            _manager.start();
            _manager.newUser("johan", password("bar"), false);
            _context = _manager.login(authToken("johan", "bar")).authorize(s => - 1, GraphDatabaseSettings.DEFAULT_DATABASE_NAME);
        }
コード例 #3
0
 public ProcedureGDBFacadeSPI(DataSourceModule sourceModule, DependencyResolver resolver, CoreAPIAvailabilityGuard availability, ThrowingFunction <URL, URL, URLAccessValidationError> urlValidator, SecurityContext securityContext, ThreadToStatementContextBridge threadToTransactionBridge)
 {
     this._databaseLayout            = sourceModule.NeoStoreDataSource.DatabaseLayout;
     this._sourceModule              = sourceModule;
     this._resolver                  = resolver;
     this._availability              = availability;
     this._urlValidator              = urlValidator;
     this._securityContext           = securityContext;
     this._threadToTransactionBridge = threadToTransactionBridge;
 }
コード例 #4
0
        private static BasicContext CreateContext(SecurityContext securityContext, DependencyResolver dependencyResolver, ProcedureCallContext procedureCallContext)
        {
            BasicContext ctx = new BasicContext();

            ctx.Put(SECURITY_CONTEXT, securityContext);
            ctx.Put(PROCEDURE_CALL_CONTEXT, procedureCallContext);
            ctx.Put(DEPENDENCY_RESOLVER, dependencyResolver);
            ctx.Put(DATABASE_API, dependencyResolver.ResolveDependency(typeof(GraphDatabaseAPI)));
            return(ctx);
        }
コード例 #5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.collection.RawIterator<Object[],org.neo4j.internal.kernel.api.exceptions.ProcedureException> procedureCallDbms(int id, Object[] input, org.neo4j.graphdb.DependencyResolver dependencyResolver, org.neo4j.internal.kernel.api.security.SecurityContext securityContext, org.neo4j.kernel.api.ResourceTracker resourceTracker, org.neo4j.internal.kernel.api.procs.ProcedureCallContext procedureCallContext) throws org.neo4j.internal.kernel.api.exceptions.ProcedureException
        public override RawIterator <object[], ProcedureException> ProcedureCallDbms(int id, object[] input, DependencyResolver dependencyResolver, SecurityContext securityContext, ResourceTracker resourceTracker, ProcedureCallContext procedureCallContext)
        {
            BasicContext ctx = CreateContext(securityContext, dependencyResolver, procedureCallContext);

            return(_procedures.callProcedure(ctx, id, input, resourceTracker));
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionOverridden()
        public virtual void ShouldMakeNiceDescriptionOverridden()
        {
            SecurityContext overridden = _context.withMode(new OverriddenAccessMode(_context.mode(), [email protected]_Static.Read));

            assertThat(overridden.Description(), equalTo("user 'johan' with FULL overridden by READ"));
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionRestricted()
        public virtual void ShouldMakeNiceDescriptionRestricted()
        {
            SecurityContext restricted = _context.withMode(new RestrictedAccessMode(_context.mode(), [email protected]_Static.Read));

            assertThat(restricted.Description(), equalTo("user 'johan' with FULL restricted to READ"));
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionWithMode()
        public virtual void ShouldMakeNiceDescriptionWithMode()
        {
            SecurityContext modified = _context.withMode([email protected]_Static.Write);

            assertThat(modified.Description(), equalTo("user 'johan' with WRITE"));
        }
コード例 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeNiceDescriptionAuthDisabled()
        public virtual void ShouldMakeNiceDescriptionAuthDisabled()
        {
            SecurityContext disabled = SecurityContext.AUTH_DISABLED;

            assertThat(disabled.Description(), equalTo("AUTH_DISABLED with FULL"));
        }