Axiomatics - condition editor












3















I have a subject like "accessTo" = ["123", "123-edit"]
and a resource like "interestedId" = "123"



Now I'm trying to write a condition - where it checks "interestedId" concatenated with "-edit" equals "123-edit" in "AccessTo".



Im trying to write rule like this



anyOfAny_xacml1(function[stringEqual], "accessTo", "interestedId"+"-edit") 


It is not allowing to do this.



Any help is appreciated.










share|improve this question

























  • Out of curiosity, what's your use case? Which PDP are you using?

    – David Brossard
    Nov 28 '18 at 23:00
















3















I have a subject like "accessTo" = ["123", "123-edit"]
and a resource like "interestedId" = "123"



Now I'm trying to write a condition - where it checks "interestedId" concatenated with "-edit" equals "123-edit" in "AccessTo".



Im trying to write rule like this



anyOfAny_xacml1(function[stringEqual], "accessTo", "interestedId"+"-edit") 


It is not allowing to do this.



Any help is appreciated.










share|improve this question

























  • Out of curiosity, what's your use case? Which PDP are you using?

    – David Brossard
    Nov 28 '18 at 23:00














3












3








3


0






I have a subject like "accessTo" = ["123", "123-edit"]
and a resource like "interestedId" = "123"



Now I'm trying to write a condition - where it checks "interestedId" concatenated with "-edit" equals "123-edit" in "AccessTo".



Im trying to write rule like this



anyOfAny_xacml1(function[stringEqual], "accessTo", "interestedId"+"-edit") 


It is not allowing to do this.



Any help is appreciated.










share|improve this question
















I have a subject like "accessTo" = ["123", "123-edit"]
and a resource like "interestedId" = "123"



Now I'm trying to write a condition - where it checks "interestedId" concatenated with "-edit" equals "123-edit" in "AccessTo".



Im trying to write rule like this



anyOfAny_xacml1(function[stringEqual], "accessTo", "interestedId"+"-edit") 


It is not allowing to do this.



Any help is appreciated.







authorization access-control xacml abac alfa






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 '18 at 22:54









David Brossard

8,50433556




8,50433556










asked Nov 27 '18 at 23:23









user2608601user2608601

274




274













  • Out of curiosity, what's your use case? Which PDP are you using?

    – David Brossard
    Nov 28 '18 at 23:00



















  • Out of curiosity, what's your use case? Which PDP are you using?

    – David Brossard
    Nov 28 '18 at 23:00

















Out of curiosity, what's your use case? Which PDP are you using?

– David Brossard
Nov 28 '18 at 23:00





Out of curiosity, what's your use case? Which PDP are you using?

– David Brossard
Nov 28 '18 at 23:00












2 Answers
2






active

oldest

votes


















2














In addition to the answer from Keerthi S ...



If you know there should only be one value of interestedId then you can do this to prevent the indeterminate from happening:



stringBagSize(interestedId) == 1 && anyOfAny(function[stringEqual], accessTo, stringOneAndOnly(interestedId) + "-edit")



If more than value is present then evaluation stops prior to reaching the function that expects only one value. This condition would return false if more than one value is present.



On the other hand if interestedId can have multiple values then this would work:



anyOfAny(function[stringEqual], accessTo, map(function[stringConcatenate],interestedId, "-edit"))



The map function will apply the stringConcatenate function to all values in the bag.






share|improve this answer

































    1














    Since Axiomatics products are compliant with XACML specification, all attributes by default are assumed to contain multiple values(called as 'bags').



    So if you would like to append a string to an attribute use stringOneAndOnly XACML function for the attribute to indicate that the attribute can have only one value.



    So assuming you mean accessTo has attribute ID as Attributes.access_subject.subject_id, interestedId has the attribute ID as Attributes.resource.resource_id and anyOfAny_xacml1 is equivalent to anyOfAny XACML function, the resulting condition would look like,



    anyOfAny(function[stringEqual], Attributes.access_subject.subject_id, stringOneAndOnly(Attributes.resource.resource_id) + "-edit")





    share|improve this answer





















    • 1





      Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

      – user2608601
      Nov 28 '18 at 18:01






    • 2





      The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

      – Keerthi S
      Nov 28 '18 at 20:56













    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53509759%2faxiomatics-condition-editor%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    In addition to the answer from Keerthi S ...



    If you know there should only be one value of interestedId then you can do this to prevent the indeterminate from happening:



    stringBagSize(interestedId) == 1 && anyOfAny(function[stringEqual], accessTo, stringOneAndOnly(interestedId) + "-edit")



    If more than value is present then evaluation stops prior to reaching the function that expects only one value. This condition would return false if more than one value is present.



    On the other hand if interestedId can have multiple values then this would work:



    anyOfAny(function[stringEqual], accessTo, map(function[stringConcatenate],interestedId, "-edit"))



    The map function will apply the stringConcatenate function to all values in the bag.






    share|improve this answer






























      2














      In addition to the answer from Keerthi S ...



      If you know there should only be one value of interestedId then you can do this to prevent the indeterminate from happening:



      stringBagSize(interestedId) == 1 && anyOfAny(function[stringEqual], accessTo, stringOneAndOnly(interestedId) + "-edit")



      If more than value is present then evaluation stops prior to reaching the function that expects only one value. This condition would return false if more than one value is present.



      On the other hand if interestedId can have multiple values then this would work:



      anyOfAny(function[stringEqual], accessTo, map(function[stringConcatenate],interestedId, "-edit"))



      The map function will apply the stringConcatenate function to all values in the bag.






      share|improve this answer




























        2












        2








        2







        In addition to the answer from Keerthi S ...



        If you know there should only be one value of interestedId then you can do this to prevent the indeterminate from happening:



        stringBagSize(interestedId) == 1 && anyOfAny(function[stringEqual], accessTo, stringOneAndOnly(interestedId) + "-edit")



        If more than value is present then evaluation stops prior to reaching the function that expects only one value. This condition would return false if more than one value is present.



        On the other hand if interestedId can have multiple values then this would work:



        anyOfAny(function[stringEqual], accessTo, map(function[stringConcatenate],interestedId, "-edit"))



        The map function will apply the stringConcatenate function to all values in the bag.






        share|improve this answer















        In addition to the answer from Keerthi S ...



        If you know there should only be one value of interestedId then you can do this to prevent the indeterminate from happening:



        stringBagSize(interestedId) == 1 && anyOfAny(function[stringEqual], accessTo, stringOneAndOnly(interestedId) + "-edit")



        If more than value is present then evaluation stops prior to reaching the function that expects only one value. This condition would return false if more than one value is present.



        On the other hand if interestedId can have multiple values then this would work:



        anyOfAny(function[stringEqual], accessTo, map(function[stringConcatenate],interestedId, "-edit"))



        The map function will apply the stringConcatenate function to all values in the bag.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 29 '18 at 16:47

























        answered Nov 29 '18 at 15:31









        Mark BergMark Berg

        214




        214

























            1














            Since Axiomatics products are compliant with XACML specification, all attributes by default are assumed to contain multiple values(called as 'bags').



            So if you would like to append a string to an attribute use stringOneAndOnly XACML function for the attribute to indicate that the attribute can have only one value.



            So assuming you mean accessTo has attribute ID as Attributes.access_subject.subject_id, interestedId has the attribute ID as Attributes.resource.resource_id and anyOfAny_xacml1 is equivalent to anyOfAny XACML function, the resulting condition would look like,



            anyOfAny(function[stringEqual], Attributes.access_subject.subject_id, stringOneAndOnly(Attributes.resource.resource_id) + "-edit")





            share|improve this answer





















            • 1





              Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

              – user2608601
              Nov 28 '18 at 18:01






            • 2





              The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

              – Keerthi S
              Nov 28 '18 at 20:56


















            1














            Since Axiomatics products are compliant with XACML specification, all attributes by default are assumed to contain multiple values(called as 'bags').



            So if you would like to append a string to an attribute use stringOneAndOnly XACML function for the attribute to indicate that the attribute can have only one value.



            So assuming you mean accessTo has attribute ID as Attributes.access_subject.subject_id, interestedId has the attribute ID as Attributes.resource.resource_id and anyOfAny_xacml1 is equivalent to anyOfAny XACML function, the resulting condition would look like,



            anyOfAny(function[stringEqual], Attributes.access_subject.subject_id, stringOneAndOnly(Attributes.resource.resource_id) + "-edit")





            share|improve this answer





















            • 1





              Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

              – user2608601
              Nov 28 '18 at 18:01






            • 2





              The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

              – Keerthi S
              Nov 28 '18 at 20:56
















            1












            1








            1







            Since Axiomatics products are compliant with XACML specification, all attributes by default are assumed to contain multiple values(called as 'bags').



            So if you would like to append a string to an attribute use stringOneAndOnly XACML function for the attribute to indicate that the attribute can have only one value.



            So assuming you mean accessTo has attribute ID as Attributes.access_subject.subject_id, interestedId has the attribute ID as Attributes.resource.resource_id and anyOfAny_xacml1 is equivalent to anyOfAny XACML function, the resulting condition would look like,



            anyOfAny(function[stringEqual], Attributes.access_subject.subject_id, stringOneAndOnly(Attributes.resource.resource_id) + "-edit")





            share|improve this answer















            Since Axiomatics products are compliant with XACML specification, all attributes by default are assumed to contain multiple values(called as 'bags').



            So if you would like to append a string to an attribute use stringOneAndOnly XACML function for the attribute to indicate that the attribute can have only one value.



            So assuming you mean accessTo has attribute ID as Attributes.access_subject.subject_id, interestedId has the attribute ID as Attributes.resource.resource_id and anyOfAny_xacml1 is equivalent to anyOfAny XACML function, the resulting condition would look like,



            anyOfAny(function[stringEqual], Attributes.access_subject.subject_id, stringOneAndOnly(Attributes.resource.resource_id) + "-edit")






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 17 '18 at 20:12

























            answered Nov 28 '18 at 9:04









            Keerthi SKeerthi S

            174112




            174112








            • 1





              Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

              – user2608601
              Nov 28 '18 at 18:01






            • 2





              The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

              – Keerthi S
              Nov 28 '18 at 20:56
















            • 1





              Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

              – user2608601
              Nov 28 '18 at 18:01






            • 2





              The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

              – Keerthi S
              Nov 28 '18 at 20:56










            1




            1





            Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

            – user2608601
            Nov 28 '18 at 18:01





            Thanks so much for your response, it really saved my day. Just to be clear, when I use this stringOneAndOnly, I need to make sure Attributes.resource.resource_id is just a string and an array or it doesn't matter and I just need to make sure array with one value?

            – user2608601
            Nov 28 '18 at 18:01




            2




            2





            The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

            – Keerthi S
            Nov 28 '18 at 20:56







            The stringOneAndOnly function checks if the attribute(here Attributes.resource.resource_id) is single-valued string. So you need to ensure that the attribute has only one value and if it has multiple values(bag), the evaluation would result a indeterminate decision. Assuming that you are using a JSON request, it can have only one value in the array of type string

            – Keerthi S
            Nov 28 '18 at 20:56




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53509759%2faxiomatics-condition-editor%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)