Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Generic Object Services -> restrict toolbar functions?

Former Member
0 Kudos

Hello,

When I create a URL link to an object, there is always a 'delete' button in the toolbar of the attachment list. Apparently, there are no authorization checks being made and everyone can delete this link.

Is it possible to remove this button from the toolbar? Or at least making sure that not everyone can delete the link?

Thanks!

1 ACCEPTED SOLUTION

GrahamRobbo
Active Contributor
0 Kudos

Hi Dave,

there are some BADI's that help you do this. Check OSS note 491271 for how to do this on specific basis releases.

Cheers

Graham

5 REPLIES 5

franois_henrotte
Active Contributor
0 Kudos

you can see in method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS of class CL_GOS_ATTACHMENT_LIST that the delete button is always displayed

I'm afarid there is no simple solution...

Former Member
0 Kudos

I couldn't find it, but I'm pretty sure there's a note related to this.

Rob

0 Kudos

Hi,

I think you are using CL_GOS* class for this. then


module call_gos_attachment output.
"<< I have created a authorisation object and 
" and called here if user have only display or change
" access then the ip_mode will get value passed
" accordingly


  if ( sy-tcode eq c_yars2 or sy-tcode eq c_yars3 ).
      i_borident-objtype = 'YARS_ATTA'.
      i_borident-objkey = yarshdr-docno.
      create object gos_manager
        exporting
           is_object            = i_borident
           it_service_selection = i_services
           ip_no_commit         = ' '
        exceptions
           object_invalid       = 1.
    else.                                " Display Mode
      i_borident-objtype = 'YARS_ATTA'.
      i_borident-objkey = yarshdr-docno.
      create object gos_manager
        exporting
           is_object            = i_borident
           it_service_selection = i_services
           ip_mode              = 'D'      "<<<<<< Check for display mode 
        exceptions
           object_invalid       = 1.
    endif.
endmodule.                               " Call_gos_attachment Output

or if this suit your need then

    create object gos_view
      exporting
        ip_mode = 'D'.                     " <<<<Display Mode
* Start GOS Service for attachement view
    i_viewobj-objtype = 'YARS_ATTA'.
    i_viewobj-objkey = yarshdr-docno.
    call method gos_view->start_service_direct
      exporting
        ip_service = 'VIEW_ATTA'
        is_object  = i_viewobj.

This i have done it for one of the custom Generic object, i think this one will help you out.

GrahamRobbo
Active Contributor
0 Kudos

Hi Dave,

there are some BADI's that help you do this. Check OSS note 491271 for how to do this on specific basis releases.

Cheers

Graham

0 Kudos

Thanks for the help everyone!