은 어떤 그룹에 관심이있는 모든 것 사용자 정의 함수를 정의하는 ALFA의 현재 버전의 방법이되지 않습니다.
그러나, 당신은 아주 잘 조언을 포함하는 규칙을 정의 할 수 있습니다/의무를 모든 논리와 함께 사용하고 필요한 모든 장소에서 규칙을 참조하십시오.
namespace so{
import Attributes.*
attribute messageContent{
category = environmentCat
id = "messageContent"
type = string
}
obligation message = "message"
/**
* Reusable rule with obligation pattern
*/
rule giveReason{
deny
on deny {
obligation message{
subjectId = subjectId
currentDateTime = currentDateTime
messageContent = "Hi, "+stringOneAndOnly(subjectId)+
". You cannot do action "+
stringOneAndOnly(Attributes.actionId)+
" on "+stringOneAndOnly(resourceId)+
" at "+stringFromDateTime(dateTimeOneAndOnly(currentDateTime))+"."
}
}
}
/**
* Your policies
*/
policyset somePS{
apply firstApplicable
policy example1{
apply firstApplicable
/**
* Other rules go here
*/
giveReason // link to common rule
}
policy example2{
apply firstApplicable
/**
* Other rules go here
*/
giveReason // link to common rule
}
}
}
: ALFA, 당신은 (XML/XACML에 수 없습니다 뭔가를) 규칙 요소를 여기
은 예입니다 참조 할 수 있습니다