I have a problem with Declarative Security and cannot find tool to properly debugging it.
I have read SmartGWT Quickstart guide, and already searched for answer in FAQ & Forum, but still could not find any answer related to my problem.
I want to use Declarative Security in my development, but I don't want to modify Authentication mechanism of Eclipse built-in Jetty. So, I decided to use subclass of IDACall and set:
rpc.setAuthenticated(true)
rpc.setUserRoles("sales,manager")
I already make sure that my IDACall subclass has been called with my own debugging code as can be seen from the log:
LOGIN: rpc.roles=[sales, manager]
However, when I set viewRequiresRole & editRequiresRole in my datasource it simply didn't work out.
<DataSource
ID="customer"
serverType="sql"
tableName="customer"
testFileName="customer.data.xml"
>
<fields>
<field name="customerId" title="Id" type="text" primaryKey="true" required="true"/>
<field name="customerName" title="Name" type="text" required="true"/>
<field name="address" title="Address" type="text" viewRequiresRole="manager" />
<field name="contact" title="Contact" type="text" editRequiresRole="sales" />
</fields>
</DataSource>
The field "Address" simply did not show up even when the role is correct, and the field "Contact" cannot be edit as well.
I tried to troubleshoot myself but I could not find the tools to help in debugging this problem.
I have read SmartGWT Quickstart guide, and already searched for answer in FAQ & Forum, but still could not find any answer related to my problem.
I want to use Declarative Security in my development, but I don't want to modify Authentication mechanism of Eclipse built-in Jetty. So, I decided to use subclass of IDACall and set:
rpc.setAuthenticated(true)
rpc.setUserRoles("sales,manager")
I already make sure that my IDACall subclass has been called with my own debugging code as can be seen from the log:
LOGIN: rpc.roles=[sales, manager]
However, when I set viewRequiresRole & editRequiresRole in my datasource it simply didn't work out.
<DataSource
ID="customer"
serverType="sql"
tableName="customer"
testFileName="customer.data.xml"
>
<fields>
<field name="customerId" title="Id" type="text" primaryKey="true" required="true"/>
<field name="customerName" title="Name" type="text" required="true"/>
<field name="address" title="Address" type="text" viewRequiresRole="manager" />
<field name="contact" title="Contact" type="text" editRequiresRole="sales" />
</fields>
</DataSource>
The field "Address" simply did not show up even when the role is correct, and the field "Contact" cannot be edit as well.
I tried to troubleshoot myself but I could not find the tools to help in debugging this problem.