Hi All @Bhathiya : This is about usability. We cannot let user do something and let it fail and then let know the user that you cannot do this. We need to inform that to user when he try to do it. That's what we are trying to achieve here.
@Anuruddha : However there are few notes. In [1] what Dimuthu mentioned is to use af runtime database data for this. When we use that you need to have full name. One way is to use same logic used by SS in our code to generate the code in our side as well. Downside of this is if SS change this we need to change it in our code as well. Or else we can search using some pattern like this in db. "<given_db_user_name>_%". However in the latter case the regular expression should be carefully selected. @Dimuthu : WDYT? [1] https://wso2.org/jira/browse/APPFAC-2723 Thanks & Regards Danushka Fernando Software Engineer WSO2 inc. http://wso2.com/ Mobile : +94716332729 On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara <[email protected]> wrote: > Hi Anurudhdha, > > In this use case, why are you trying to check the user existence? Are you > trying to do it before user creation? In that case, you don't have to check > it yourself because create user service will do it internally, and throw an > exception if the user exists. So your try-catch approach is fine. > > Thanks, > Bhathiya > > On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal <[email protected]> > wrote: > >> Hi, >> >> I'm working on APPFAC-2723 and there is a requirement to check whether a >> user is already created in storage server. >> >> In RssAdminService there is a method to check whether a database user >> exists. >> >> Issue with this method is, there has a hashed tenant domain value >> appended to the username once we create a databaseuser, and it requires >> the full name (with the appended value) to check the user existence. >> >> Isn't it the RSSAdmin service responsibility to append the hashed value >> and perform the search?. >> >> For now I can use a try catch block in the jaggery layer and handle the >> duplicate user creation exception. >> >> AppFactory_Resource_DB has this full user name and perform >> isDataBaseuserExist operation. However this method always resurns false >> because we haven't passed the appended hashed value with the username. >> >> Shall we remove this isDataBaseUserExist method from the ResourceManger >> and use try catch approach to check the user existence? >> >> Regards, >> -- >> *Anuruddha Premalal* >> Software Eng. | WSO2 Inc. >> Mobile : +94710461070 >> Web site : www.regilandvalley.com >> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Bhathiya Jayasekara* > *Software Engineer,* > *WSO2 inc., http://wso2.com <http://wso2.com>* > > *Phone: +94715478185 <%2B94715478185>* > *LinkedIn: http://www.linkedin.com/in/bhathiyaj > <http://www.linkedin.com/in/bhathiyaj>* > *Twitter: https://twitter.com/bhathiyax <https://twitter.com/bhathiyax>* > *Blog: http://movingaheadblog.blogspot.com > <http://movingaheadblog.blogspot.com/>* > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
