Home > Discussion Forum dm_developer Discussion Forum

Go Back   dm_developer Discussion Forum > Documentum Products > Documentum 6

Reply
 
Thread Tools Display Modes
  #1  
Old March 15, 2010, 09:50 AM
ntsav2 ntsav2 is offline
Registered User
 
Join Date: Mar 2010
Posts: 15
How to Override getDfSession() method in WDK action handler class?

Hi,

I am customizing a WDK action component,And my handler class extends the WDK newgroup action class. I know that WDK uses the current session of the user in the handlerclass by calling getDfsession(), but i want to override this getDfsession and in order to use a superUser session.

The end user will not be given the privilege to perform the action, so the action has to be performed using superuser session.
How can I override the getDfsession instances in my extended handler class to use my Superuser session.

Thank you in advance.
Reply With Quote
  #2  
Old March 15, 2010, 10:00 AM
johnnygee_va johnnygee_va is offline
Registered User
 
Join Date: Jun 2003
Location: Washington DC
Posts: 3,971
"The end user will not be given the privilege to perform the action, so the action has to be performed using superuser session."

- The way I have done this in the past is to create a server method, configure it to "run as server", and then call the server method with apply() method from WDK component.
__________________
__________________
Johnny Gee
Principal Architect
Beach Street Consulting
Blog: http://johnnygee.wordpress.com
Reply With Quote
  #3  
Old March 15, 2010, 10:24 AM
ntsav2 ntsav2 is offline
Registered User
 
Join Date: Mar 2010
Posts: 15
Thank you Johnny .
I needed little clarification on this. I created a util class which contains my new getDfSession method that returns superuser session.
And now I created a new dm_method object for my util class.
But I did not understand how to apply my dm_method to WDK component?Can you please guide me how to do so?

I have created "getDfSession" method in my util class so after applying my method to my component will all the instances of wdk getDfSession are picked up from my util class?
Reply With Quote
  #4  
Old March 15, 2010, 12:36 PM
johnnygee_va johnnygee_va is offline
Registered User
 
Join Date: Jun 2003
Location: Washington DC
Posts: 3,971
IDfSession.apply() - executes server method
__________________
__________________
Johnny Gee
Principal Architect
Beach Street Consulting
Blog: http://johnnygee.wordpress.com
Reply With Quote
  #5  
Old March 15, 2010, 05:05 PM
ntsav2 ntsav2 is offline
Registered User
 
Join Date: Mar 2010
Posts: 15
Jhonny now I understand that....this server method is invoked from my wdk class using Idfsession.apply().
But my requirement is different here.My WDK class is extending Groupattributes.class and I want all the methods of my new class and Groupattributes class to be performed using superuser privileges.
I mean whenever the Groupattributes.class/custom class calls getDfSession in any of its methos that instance should be of SUPERUSER session.

Can I override the getDfSession method in my Handler class. Will that solve my problem?
Reply With Quote
  #6  
Old March 16, 2010, 07:34 AM
johnnygee_va johnnygee_va is offline
Registered User
 
Join Date: Jun 2003
Location: Washington DC
Posts: 3,971
What are you trying to do Group class? If you want to give a normal user the ability to manage groups, just define Admin Access in DA and grant that user/group access to the user management node.
__________________
__________________
Johnny Gee
Principal Architect
Beach Street Consulting
Blog: http://johnnygee.wordpress.com
Reply With Quote
  #7  
Old March 16, 2010, 11:22 AM
ntsav2 ntsav2 is offline
Registered User
 
Join Date: Mar 2010
Posts: 15
Johnny,
Thank you for the reply.I understand that group management is possibly by appropriate privileges.
But as per my requirement the end users are not given group management privileges and they should not see Groups node.
So we have to create a custom node extending groups node which displays only certain groups essential for the end users.
In this custom node they have to create groups (During the group creation the custom default values are assigned to the group object including group_owner).
So In the menubar component we created a new_action_menu_item that creates new groups(as mentioned above). So this create group must be performed by only SUPER USER and we have the specific purpose for that like auditing. (the user performing the action will not have create group privileges, they can only see the menu item and click on it) .
I hope you had better understanding this time :)

So in my handlerclass which extends GroupAttributes I have overwritten the getDfSession method to get the super user session instead of the current user performing the WDK action. So I wonder if this will create any problem?
Please help.
Thank you in advance.
Reply With Quote
  #8  
Old March 16, 2010, 12:57 PM
johnnygee_va johnnygee_va is offline
Registered User
 
Join Date: Jun 2003
Location: Washington DC
Posts: 3,971
The problem is that you cant get superuser session from a normal user session. You basically have to establish a new session using super user name and password. This normally means you have to save this info in a properties file or some other place that you can change. Controlling access to the file is usually a big security risk.

If you write server method, you dont need to provide user name and password.
__________________
__________________
Johnny Gee
Principal Architect
Beach Street Consulting
Blog: http://johnnygee.wordpress.com
Reply With Quote
  #9  
Old March 18, 2010, 01:24 PM
ntsav2 ntsav2 is offline
Registered User
 
Join Date: Mar 2010
Posts: 15
Thank you Johnny for making me aware of the risk.
But we had a standard implementation for getting a sessionmanger for superuser from a utilclass. So I just used an instance of this to get the session from which I could achieve what I wanted.
Thank you for all the replies.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 04:05 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.