我想知道下面的函数urn:oasis:names:tc:xacml:3.0:function:string-contains的解释
我有一个要求,即用户ID字符串需要与包含Suresh,suresh pelluru,Suresh prakash,Suresh Group等的字符串进行比较。
哪个函数用于与suresh进行比较(区分大小写)
谢谢,苏雷什·佩鲁鲁。
发布于 2014-07-03 20:26:38
在XACML中有几个字符串比较函数:
string-contains接受两个数据类型为string的参数,并返回一个boolean。如果第二个字符串包含第一个字符串,则函数返回true,否则返回false。相等性测试是按照urn:oasis:names:tc:xacml:1.0:function:string-equal的定义进行的。
示例:
string-contains("alice", "alice is in the woods"):这将返回true.string-contains("alice is in the woods", "alice"):这将返回false。整个函数列表都是available here。
发布于 2014-07-04 18:11:45
根据您的要求,如果您需要以区分大小写的方式比较用户名列表中的用户名,则可以在您的条件/目标等中使用以下方法之一:
<Apply FunctionId=”urn:oasis:names:tc:xacml:3.0:function:any-of”>
<Function FunctionId=”urn:oasis:names:tc:xacml:1.0:function:string-equal”/>
<AttributeValue DataType=”http://www.w3.org/2001/XMLSchema#string”>suresh</AttributeValue>
<Apply FunctionId=”urn:oasis:names:tc:xacml:1.0:function:string-bag”>
<AttributeValue DataType=”http://www.w3.org/2001/XMLSchema#string”>Suresh</AttributeValue>
<AttributeValue DataType=”http://www.w3.org/2001/XMLSchema#string”>suresh</AttributeValue>
<AttributeValue DataType=”http://www.w3.org/2001/XMLSchema#string”>suresh pelluru</AttributeValue>
<AttributeValue DataType=”http://www.w3.org/2001/XMLSchema#string”>Suresh Prakash</AttributeValue>
</Apply>
</Apply>https://stackoverflow.com/questions/24551132
复制相似问题