java - com.tivoli.mts.PDPrincipal.implies(com.tivoli.mts.PDPermission) deprecated -
i using below code authorizatin checks.
pdprincipal whoisit = new pdprincipal(userid,configurl); pdpermission whattheywant = new pdpermission(objectspacename,"tbva"); boolean haveaccess = whoisit.implies(whattheywant);
however implies method on com.tivoli.mts.pdprincipal has been deprecated , has been replaced implies method new pdprincipal class different package.
com.tivoli.pd.jazn.pdprincipal
the new method follows. public boolean implies(javax.security.auth.subject subject)
the new method takes subject.
can please let me know how can change code use new method? how construct subject or can subject somewhere?
thanks, rohit
i able work out solution hence sharing here else facing same issue can use code.
i found new com.tivoli.pd.jazn.pdpermission class has method implies takes in pdauthorization context , com.tivoli.pd.jazn.pdprincipal object same authorization checks previous class com.tivoli.mts.pdprincipal use do.
mentioned below how same authorization can done. code need not implement jaas code.
first construct pdauthorizationcontext shown below. make sure define static pdauthorizationcontext object can reused untill close it. constructing pdauthorizationcontext every authorization check resource intensive , not recommended. close context @ end of logic
url configurl = new url("file:" + string locationtotamconfigfile); pdauthorizationcontext pdauthctx = new pdauthorizationcontext(configurl);
next construct new pdprincipal , pdpermission objects shown below , call implies method
com.tivoli.pd.jazn.pdprincipal pdprincipal = new com.tivoli.pd.jazn.pdprincipal(pdauthctx,userid); com.tivoli.pd.jazn.pdpermission pdpermission = new com.tivoli.pd.jazn.pdpermission(objectspacename,"tbva"); boolean newimpliestry = pdpermission.implies(pdauthctx,pdprincipal);
Comments
Post a Comment