Our scenario is, user will provide UCM folder path where we've to upload a file which we generate locally. Before doing the generation of file process, we're checking that whether the folder is valid or not. Apart from doing this check we also have to check whether the user has privilege to do the check_in for a specified folder with security group.
We can achieve this by doing check_in a temp/zero byte file to that specified folder and if it success then he has privilege otherwise he don't have. Also we've to delete the temporary file after the privilege check.
Instead of doing all these process, Is there any way to check/any API to validate the privilege check on UCM folder for specific security group?
This is a standard security check which is part of CHECKIN_* services.
If you do it from GUI you won't be able to select the security group to which user has not necessary permissions. If you do it from a program (RIDC, WS, etc) you request will fail, and you will get an error message in the response.
I'm not sure I completely follow you with the "privilege".
To answer your question, yes, you may enhance behaviour of standard services such as CHECKIN_UNIVERSAL via so called "filters". Filters are Java pieces of code, that might be hooked to "filter events" such as validateCheckinData. When a service is being processed, the filter code is triggered on that event automatically.
However, the checkin services already contain a security check (it calls a Java method from the standard code), and it will do checks like "can this user check in a document with such a security group?" or "does this folder exist?", no extra code needed. So, I'm not sure what your enhancement would do additional.