Hi Thusitha,

As we discuss yesterday this happens because of the automation.xml that you
are using does not define any roles to  those tenant users. If
automation.xml not contain any user-role mapping the automation framework
will add admin role to those users.


You can add roles and do the mapping as bellow,

                <user key="user2">
                    <userName>testuser21</userName>
                    <password>testuser21</password>
                    <roles>
                        <role>role1</role>
                    </roles>
                </user>
            </users>
        </tenant>
    </tenants>
    <roles>
        <role name="role1">
            <permissions>
                <permission>/permission/admin/configure</permission>
                <permission>/permission/admin/login</permission>
                <permission>/permission/admin/manage</permission>
                <permission>/permission/admin/monitor</permission>
            </permissions>
        </role>
        <role name="role2">
            <permissions>
                <permission>/permission/admin/configure</permission>
                <permission>/permission/admin/login</permission>
            </permissions>
        </role>
    </roles>
</userManagement>




Thanks and Best Regards,

Saneth Dharmakeerthi
Senior Software Engineer
WSO2, Inc.
Mobile: +94772325511

On Thu, Jun 18, 2015 at 6:36 PM, Thusitha Thilina Dayaratne <
thusit...@wso2.com> wrote:

> Hi,
>
> I'm trying to write some tests for the user core functionalities. While
> doing so when I try to create a user from a non admin user as follows.
>
> super.init(TestUserMode.SUPER_TENANT_USER);
>
> userManagementClient.addUser(username, password, null, null);
>
> Since non-admin users don't have permissions to create users this should
> throws an Exception.  But this get executed and user is getting created.
> When I checked the roles of the executing user at the debug time using
>
> userManagementClient.getRolesOfCurrentUser()
>
> It has the admin role as well.
>
> I have create the JIRA[1]
> [1] - https://wso2.org/jira/browse/TA-978
>
>
> Please correct me if my assumption is wrong.
>
> Thanks
>
> --
> Thusitha Dayaratne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> Mobile  +94712756809
> Blog      alokayasoya.blogspot.com
> About    http://about.me/thusithathilina
>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to