[ 
https://issues.apache.org/jira/browse/FC-187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15553224#comment-15553224
 ] 

Shawn McKinney commented on FC-187:
-----------------------------------

Here is another example where contextId is not being set.  Actually there is 
another problem, the input objects are not being validated to ensure not null.  
Both can be done with one call to assertContext as below:

public class ReviewMgrImpl extends Manageable implements ReviewMgr, Serializable
{
...
    @Override
    public List<RoleConstraint> findRoleConstraints(User user, Permission 
permission, RoleConstraintType rcType) throws SecurityException
    {
        String methodName = "findRoleConstraints";
        assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
        assertContext(CLS_NM, methodName, permission, GlobalErrIds.PERM_NULL);


> pass the tenantid
> -----------------
>
>                 Key: FC-187
>                 URL: https://issues.apache.org/jira/browse/FC-187
>             Project: FORTRESS
>          Issue Type: Sub-task
>    Affects Versions: 1.0.1
>            Reporter: Shawn McKinney
>            Assignee: Shawn McKinney
>             Fix For: 2.0.0-RC1
>
>
> There were a couple of places where the tenantid wasn't being passed down to 
> the DAO.  
> Mostly centered around this method below.  Notice how the tenantid isn't 
> being passed into the api call.  
> And there is another problem in this new method creates a cycle with the 
> reviewmgrimpl as it is dependent on vutil and with this new method vice versa.
> While I'm not crazy about the solution, I have broken the code from this 
> vutil and moved into the validate methods of both the permp and userp classes.
> public final class VUtil implements ConstraintValidator
> ...
>     public static void permAttrSetName( String value ) throws 
> ValidationException
>     {                 
>       try{
>               ReviewMgr reviewMgr = ReviewMgrFactory.createInstance();        
>         
>               PermissionAttributeSet paSet = 
> reviewMgr.readPermAttributeSet(new PermissionAttributeSet(value));
>       }
>         catch(Exception e){
>             String error = "permissionAttributeSet - not found with name [" + 
> value + "]";
>             throw new ValidationException( 
> GlobalErrIds.PERM_ATTRIBUTE_SET_NOT_FOUND, error );
>         }
>         RegExUtil.getInstance().safeText( value );
>     }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to