internal FunctionResult(UserFunctionSignature signature) { this.Name = signature.Name().ToString(); this.Signature = signature.ToString(); this.Description = signature.Description().orElse(""); Roles = Stream.of("admin", "reader", "editor", "publisher", "architect").collect(toList()); ((IList <string>)Roles).AddRange(Arrays.asList(signature.Allowed())); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("OptionalGetWithoutIsPresent") @Test public void shouldNotSetProcedureAllowedIfSettingNotSetForUDF() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldNotSetProcedureAllowedIfSettingNotSetForUDF() { ConfiguredSetup(DefaultConfiguration()); Procedures procedures = Neo.LocalGraph.DependencyResolver.resolveDependency(typeof(Procedures)); UserFunctionSignature funcSig = procedures.Function(new QualifiedName(new string[] { "test" }, "nonAllowedFunc")).signature(); assertThat(Arrays.asList(funcSig.Allowed()), empty()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("OptionalGetWithoutIsPresent") @Test public void shouldSetAllowedToConfigSettingForUDF() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldSetAllowedToConfigSettingForUDF() { ConfiguredSetup(stringMap(SecuritySettings.default_allowed.name(), "nonEmpty")); Procedures procedures = Neo.LocalGraph.DependencyResolver.resolveDependency(typeof(Procedures)); UserFunctionSignature funcSig = procedures.Function(new QualifiedName(new string[] { "test" }, "nonAllowedFunc")).signature(); assertThat(Arrays.asList(funcSig.Allowed()), containsInAnyOrder("nonEmpty")); }