mirror of https://github.com/apache/cloudstack.git
api: Rename Validator to Validate, cosmetic fixes
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
b00ed17f4b
commit
6a112bd64c
|
|
@ -27,6 +27,6 @@ import com.cloud.utils.component.Adapter;
|
|||
* APIAccessChecker checks the ownership and access control to API requests
|
||||
*/
|
||||
public interface APIAccessChecker extends Adapter {
|
||||
// Interface for checking access to an API for a user
|
||||
// Interface for checking access to an API for an user
|
||||
boolean canAccessAPI(User user, String apiCommandName) throws PermissionDeniedException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.lang.annotation.Target;
|
|||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ FIELD })
|
||||
public @interface Validator {
|
||||
public @interface Validate {
|
||||
Class<?>[] validators() default Object.class;
|
||||
String description() default "";
|
||||
}
|
||||
|
|
@ -396,20 +396,19 @@ public class ApiDispatcher {
|
|||
}
|
||||
|
||||
for (Field field : fields) {
|
||||
//plug Services
|
||||
|
||||
PlugService plugServiceAnnotation = field.getAnnotation(PlugService.class);
|
||||
if(plugServiceAnnotation != null){
|
||||
plugService(field, cmd);
|
||||
}
|
||||
//APITODO: change the checking here
|
||||
|
||||
Parameter parameterAnnotation = field.getAnnotation(Parameter.class);
|
||||
if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//ACL checkAccess = field.getAnnotation(ACL.class);
|
||||
|
||||
Validator validators = field.getAnnotation(Validator.class);
|
||||
//TODO: Annotate @Validate on API Cmd classes, FIXME how to process Validate
|
||||
Validate validateAnnotation = field.getAnnotation(Validate.class);
|
||||
Object paramObj = unpackedParams.get(parameterAnnotation.name());
|
||||
if (paramObj == null) {
|
||||
if (parameterAnnotation.required()) {
|
||||
|
|
@ -530,7 +529,7 @@ public class ApiDispatcher {
|
|||
|
||||
}
|
||||
|
||||
//check access on the entities.
|
||||
//check access on the enstities.
|
||||
}
|
||||
|
||||
private static Long translateUuidToInternalId(String uuid, Parameter annotation)
|
||||
|
|
|
|||
Loading…
Reference in New Issue