Skip to Content
author's profile photo Former Member
Former Member

How to make a checkbox active based on a user's authorisation?

Hi everyone.

I have a requirement for a Web Dynpro application I've created where a user with a certain authorisation can tick a checkbox to make all the rest of my fields read-only.

I should have no problem with the read-only part based on the value of the checkbox, but the issue I would like help with is how to make the checkbox only enabled for certain user groups.

I.E. I would like the checkbox to either not show or not be enabled unless the user belongs to authorisation group 'XXX'.

Is this possible?

If anyone could point me in the right direction it would be much appreciated.

Thanks

Kieran

Edited by: Kieran Ryan on May 10, 2011 6:23 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 10, 2011 at 04:34 AM

    Hi

    Create an attribute of type WDY_BOOLEAN say ENABLE ,and bind enable property of check box.

    Check the authorization in WDDOINIT method

    i) If user is authorized set ENABLE with value "ABAP_TRUE"

    ii) If user is NOT authorized set ENABLE with value "ABAP_FALSE"

    OR

    Create one attribute of type WDUI_VISIBILITY bind to visible property of ROOTUIELEMENTCONTAINER.

    So based on login user show veiw, otherwise through some warning or error messange.

    Hope it helps.

    Cheers,

    Kris.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 10, 2011 at 04:32 AM

    HI,

    You can bind the enabled property of the check box to a context attribute of type WDY_BOOLEAN.

    WDY_BOOLEAN has values as follows,

    X-true.

    ' '-false.

    Then set this context attribute as required based on the auth group.

    This would disable the checkbox.

    However if you want to completely hide the checkbox, then bind the visible property of the checkbox to a context attribute of type

    WDUI_VISIBILITY

    WDUI_VISIBILITY has values as follows,

    01- none.

    02- visible.

    Thanks,

    Aditya.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.