You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Curt Johanson (JIRA)" <ji...@apache.org> on 2008/04/16 11:12:21 UTC

[jira] Created: (FTPSERVER-128) BaseUser fails to authorise

BaseUser fails to authorise
---------------------------

                 Key: FTPSERVER-128
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-128
             Project: FtpServer
          Issue Type: Bug
          Components: Core
         Environment: Code error, OS indeoendent
            Reporter: Curt Johanson


The BaseUser authorize method loops through the authorities objects for the user and if an authority object CAN authorize but refuses the method return null, thus ignoring authority objects later in the list that MAY be able to authorize. My suggestion to the method is the following (unless I missed something)

	public AuthorizationRequest authorize(AuthorizationRequest request) {
		Authority[] authorities = getAuthorities();

		for (int i = 0; i < authorities.length; i++) {
			Authority authority = authorities[i];

			if (authority.canAuthorize(request)) {

				if (null != authority.authorize(request)) {
					return request;
				}
			}

		}
			
		return null;
	}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.