Find

Article
· Aug 26, 2024 3m read

第八章 创建和使用策略

第八章 创建和使用策略

本主题介绍如何在 IRIS 中使用 WS-Policy 支持。WS-Policy 使您能够指定要使用或预期的 WS-Security 标头。它还使能够指定 WS-Addressing 标头和 MTOM 的使用(在创建 Web 服务和 Web 客户端中描述)。可以在单独的类中创建策略,而不是直接编辑 Web 服务或 Web 客户端。在大多数情况下,不需要进行低级编程。

概述

IRIS 中,Web 服务或客户端的策略(或策略集合)包含在单独的配置类中,即 %SOAP.Configuration的子类。编译该类时,策略生效。

通常不需要编码。但是,在某些情况下,可以通过编程指定详细信息,而不是将该元素硬编码到策略中。

Discussion (0)1
Log in or sign up to continue
Article
· Aug 26, 2024 1m read

Unwrap roles recursively

Recently I got into a situation where a user had some roles, which granted additional roles, and so on.

As I did not understand where a particular permission came from, I wrote this code which gets an initial set of roles and unwraps them recursively, accounting for any repeats.

/// Recursively unwraps roleset.
/// Accounts for circular dependencies and repeats.
Class Utils.Roles
{

/// roles: comma-separated string of roles
/// showResources: show resources in addition to roles.
/// do ##class(Utils.Roles).Display
ClassMethod Display(roles As %String, showResources As %Boolean = {$$$NO})
{
	new $namespace
	set $namespace = "%SYS"
	set roles = $lfs(roles)
	set i=0
	while i<$ll(roles) {
		do $i(i)
		set role = $lg(roles, i)
		continue:$d(processed(role))=1
		write "Current role: ", role,!
		
		write "Grants roles: "
		set sc = ##class(Security.Roles).Get(role, .p)
		for j=1:1:$l($g(p("GrantedRoles")),",") {
			set grantedrole = $p(p("GrantedRoles"),",", j)
			continue:grantedrole=""
			continue:$lf(roles, grantedrole)
			
			write grantedrole, ", "	
			
			set roles = roles _ $lb(grantedrole)
		}
		
		write:showResources !, "Grants resources: ", p("Resources")
		write !
	}
}

}
 
Spoiler

Code.

2 Comments
Discussion (2)2
Log in or sign up to continue
Announcement
· Aug 26, 2024

[Video] IA Generativa em Uso

Olá, Comunidade!

Você acha que a IA Generativa pode tornar sua vida mais fácil? Veja alguns casos de uso em potencial para GenAI no vídeo mais recente do Learning Services:

Generative AI in Use

Descubra como o GenAI está impactando tudo, desde a área da saúde até o desenvolvimento de software, e como ele pode ser usado para melhorar a produtividade e aumentar a eficiência.

👩‍💻 Pronto para tentar você mesmo?
Aprenda como melhorar suas habilidades de escrita de prompts para aproveitar ao máximo a IA generativa (exercício, 40m).

Discussion (0)1
Log in or sign up to continue
Question
· Aug 26, 2024

Send a request from a class to a different server business service

I have this code and I need to send 

Set tRequest= ##class(Testing.Messages.GatewayCreateFacilityRequest).%New()

Set tRequest.facilityCode ="VINUSE"

 Set tResponse = ##class(Testing.Messages.GatewayCreateFacilityResponse).%New()

need to send a request to a new server:

Server: ECR10 

Namespace: ECR

Business Service: Healthix.Common.Verato.Gateway.Service.HubQueryService

set tResponse = ##class(Testing.Gateway.Service.HubQueryService).%New().CreateFacility(tRequest)

How do I add code to send it to the ECR10 server?

5 Comments
Discussion (5)2
Log in or sign up to continue
Announcement
· Aug 26, 2024

[Video] Pesando os benefícios e riscos da IA ​​generativa

Olá Comunidade!

Como você pode criar uma abordagem equilibrada para usar Generative AI? Obtenha ajuda de especialistas da InterSystems no vídeo mais recente da Learning Services:

Weighing the Benefits and Risks of Generative AI

Aprenda alguns dos principais benefícios do uso de IA generativa, além de estratégias para minimizar riscos — nesta conversa com:

Inscreva-se no canal Learning Services YouTube!

Discussion (0)1
Log in or sign up to continue