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: 

Authority Check for Generic Object Service (GOS)

Former Member
0 Kudos

HI All,

In ECC6, Generic Object doesn't do any authority checks anymore, but instead they give customization options where customer can add their own checks.

My requirement is to prevent delete on GOS while allow edits. I have done the following in adding customize auth checks:

1. Copied CL_GOS_SRV_ATTACHMENT_LIST to ZCL_GOS_SRV_ATTACHMENT_LIST

2. In ZCL_GOS_SRV_ATTACHMENT_LIST there is a method called: CHECK_STATUS. I overwrote with my check;

on_mode_changed( 'D' ). --- For display

on_mode_changed( 'E' ). --- For edit mode.

3. In SGOS tcode, added VIEW_ATTA to point to ZCL_GOS_SRV_ATTACHMENT_LIST

This works, but when set for display, it does not allow DELETE or CHANGE. But when set to edit, it allow both DELETE and EDIT.

My question is how can I fine tune and allow EDIT without Delete?

Thanks in advance,

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

I am not sure if this will work in ECC 6.0, but in ECC 5.0 we can check on authorization object S_OC_ROLE as this code checks for the autorization before deleting.



      AUTHORITY-CHECK OBJECT 'S_OC_ROLE'          
                      ID     'OFFADMI'            
                      FIELD  'ADMINISTRATOR'.     

Regards,

Naimesh Patel

12 REPLIES 12

former_member182371
Active Contributor
0 Kudos

Hi,

long ago i used badi GOS_SRV_SELECT to do something similar.

Have a look at this badi and check if it´s useful to you.

This might be useful as well:

Best regards.

Edited by: Pablo Casamayor on Dec 19, 2008 10:33 AM

0 Kudos

Thanks, but I have tried GOS_SRV_SELECT and GOS_SRV_REQUEST.

In GOS_SRV_REQUEST, I added VIEW_ATTA in the attributes and tried to put in my custom code in START_SERVICE method. But I couldn't instantiate and call ATTA_LIST correctly, so it never linked to the right list of attachments. Also, I could only control the ATTA_LIST class through ON_MODE_CHANGED method. So again, its change/delete groupped together.

I have also tried GOS_SRV_SELECT. But I don't know what I can populate for ET_OPTIONS. Could any give me some examples?

0 Kudos

I have a something similar issue so i added with new entry in the conext menu only EDIT and another one for DELETE. Please check this link

a®s

0 Kudos

Thanks, I was reading your post and I couldn't figure out this step:

...

and then while calling the object CL_GOS_MANAGER filter out all except DELETE

When do you call CL_GOS_MANAGER and how do you filter out the DELETE?

I assume your suggestion is to remove: VIEW_ATTA CL_GOS_SRV_ATTACHMENT_LIST

from GOS, and then implement a VIEW and a DELETE seperately on the GOS?

I am not clear on how to implement the VIEW and DELETE and what class I need to call...

Any suggestion is appreciated.

Former Member

naimesh_patel
Active Contributor
0 Kudos

I am not sure if this will work in ECC 6.0, but in ECC 5.0 we can check on authorization object S_OC_ROLE as this code checks for the autorization before deleting.



      AUTHORITY-CHECK OBJECT 'S_OC_ROLE'          
                      ID     'OFFADMI'            
                      FIELD  'ADMINISTRATOR'.     

Regards,

Naimesh Patel

0 Kudos

Where did you put the authority check code? I'll try that.

Thanks,

Charlie

0 Kudos

The authority code is already there in place.

Check

Class CL_MSG_AL_ITEM

Method EXECUTE

This is the code which is being executed whenever you do some action on the Attachment List.

Basically, we don't want to attach the autorization object S_OC_ROLE in the user profile for which we don't want to give the delete access.

Regards,

Naimesh Patel

0 Kudos

I placed a breakpoint in CL_MSG_AL_ITEM under EXECUTE method where the auth check is done. It never stopped there when I try to delete an GOS object from the list.

I think ECC 6 might have changed that... sad...

Former Member
0 Kudos

I copied CL_GOS_ATTACHMENTS to ZCL_GOS_ATTACHMENTS.

Then changed out all appropiate reference from CL_GOS_ATTACHMENTS to ZCL_GOS_ATTACHMENTS.

In SET_TOOLBAR method, I de-coupled delete with change and checked authority object in case of delete.

That works!

0 Kudos

Hi, Could you please advise on how to acheive the same functionality in ECC5.0 ?

Regards,

Vijayalakshmi

0 Kudos

Can you explain in detail how you de-coupled delete with change? Is this in addition to your change in CL_GOS_SRV_ATTACHMENT_LIST.

Edited by: Kamala Tummala on May 14, 2011 1:21 AM