Discussion:
Permission DataBackendException error
Jeffery Painter
2017-12-06 20:14:35 UTC
Permalink
Hi Georg,

Things are looking much better.  I am working on the role/permission
implementation stuff in the flux library.  Using your updated Turbine
4.0.1 snapshot and the flux-security snapshot release.

I was trying to figure out what you did to make TurbineUser work to try
and fix issues I am now facing with TurbinePermission, but I have not
dug too deep there yet.

The following method is giving me an exception in the security manager...

Permission perm = security.getPermissionByName(permName);

the exception looks similar to the wrapper issue we had with TurbineUser...

org.apache.torque.TorqueException:
org.apache.fulcrum.security.util.DataBackendException:
org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl cannot be cast
to org.apache.fulcrum.security.torque.peer.Peer.
The peer class org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl
should implement interface
org.apache.fulcrum.security.torque.peer.TorqueTurbinePeer
 of generic type <org.apache.turbine.fluxtest.om.TurbinePermission>.

The methods for security.getRole() and security.getGroup() seem to be
working fine, just permission is giving me trouble. I will post my
updates soon back to github so you can see where I am stuck.

Also, I submitted an update to the Turbine.java class as the
input.encoding was not getting set properly when trying to put in my own
value in the TR.props file.  Hopefully I put the fix in the right place.
It is working for me now and I can once again use UTF-8 encoding :-)

Just wondering if there might be interest in just changing the default
encoding to UTF-8 instead of ISO-8859-1 which is what it is now... not
sure why most would not want to use UTF-8 these days.

Thanks,
Jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@turbine.apache.org
For additional commands, e-mail: dev-***@turbine.apache.org
Jeffery Painter
2017-12-06 21:02:44 UTC
Permalink
Hello everyone,

I posted an update to my turbine-flux code which now supports permission
assignment to roles.  There are still some issues which I have commented
about in the doPermissions() method of the FluxRoleAction class which I
mention below.

https://github.com/jlpainter/turbine-flux/commit/4104a6bd73f26e25c9a6dd3810d6b0fb05d66147

Thanks!
Jeff
Post by Jeffery Painter
Hi Georg,
Things are looking much better.  I am working on the role/permission
implementation stuff in the flux library.  Using your updated Turbine
4.0.1 snapshot and the flux-security snapshot release.
I was trying to figure out what you did to make TurbineUser work to
try and fix issues I am now facing with TurbinePermission, but I have
not dug too deep there yet.
The following method is giving me an exception in the security manager...
Permission perm = security.getPermissionByName(permName);
the exception looks similar to the wrapper issue we had with
TurbineUser...
org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl cannot be
cast to org.apache.fulcrum.security.torque.peer.Peer.
The peer class
org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl should
implement interface
org.apache.fulcrum.security.torque.peer.TorqueTurbinePeer
 of generic type <org.apache.turbine.fluxtest.om.TurbinePermission>.
The methods for security.getRole() and security.getGroup() seem to be
working fine, just permission is giving me trouble. I will post my
updates soon back to github so you can see where I am stuck.
Also, I submitted an update to the Turbine.java class as the
input.encoding was not getting set properly when trying to put in my
own value in the TR.props file.  Hopefully I put the fix in the right
place. It is working for me now and I can once again use UTF-8
encoding :-)
Just wondering if there might be interest in just changing the default
encoding to UTF-8 instead of ISO-8859-1 which is what it is now... not
sure why most would not want to use UTF-8 these days.
Thanks,
Jeff
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@turbine.apache.org
For additional commands, e-mail: dev-***@turbine.apache.org
Jeffery Painter
2017-12-07 16:04:19 UTC
Permalink
I also discovered that security.forcePassword() works fine with the
wrapped user object, but the security.changePassword() method does
not.   I have published updates to the turbine-flux project which take
this into account in the FluxUserAction doUpdate method :-(

There is still some issue as well with security.revoke(user, group,
role) ... the implementation code looked a little strange to me (it does
three separate calls to revoke).  I tried to update to only one call,
but then it removed all user/group/role assignments!


Thanks,
Jeff
Post by Jeffery Painter
Hello everyone,
I posted an update to my turbine-flux code which now supports
permission assignment to roles.  There are still some issues which I
have commented about in the doPermissions() method of the
FluxRoleAction class which I mention below.
https://github.com/jlpainter/turbine-flux/commit/4104a6bd73f26e25c9a6dd3810d6b0fb05d66147
Thanks!
Jeff
Post by Jeffery Painter
Hi Georg,
Things are looking much better.  I am working on the role/permission
implementation stuff in the flux library.  Using your updated Turbine
4.0.1 snapshot and the flux-security snapshot release.
I was trying to figure out what you did to make TurbineUser work to
try and fix issues I am now facing with TurbinePermission, but I have
not dug too deep there yet.
The following method is giving me an exception in the security manager...
Permission perm = security.getPermissionByName(permName);
the exception looks similar to the wrapper issue we had with
TurbineUser...
org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl cannot be
cast to org.apache.fulcrum.security.torque.peer.Peer.
The peer class
org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl should
implement interface
org.apache.fulcrum.security.torque.peer.TorqueTurbinePeer
 of generic type <org.apache.turbine.fluxtest.om.TurbinePermission>.
The methods for security.getRole() and security.getGroup() seem to be
working fine, just permission is giving me trouble. I will post my
updates soon back to github so you can see where I am stuck.
Also, I submitted an update to the Turbine.java class as the
input.encoding was not getting set properly when trying to put in my
own value in the TR.props file.  Hopefully I put the fix in the right
place. It is working for me now and I can once again use UTF-8
encoding :-)
Just wondering if there might be interest in just changing the
default encoding to UTF-8 instead of ISO-8859-1 which is what it is
now... not sure why most would not want to use UTF-8 these days.
Thanks,
Jeff
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@turbine.apache.org
For additional commands, e-mail: dev-***@turbine.apache.org
Georg Kallidis
2017-12-07 16:48:34 UTC
Permalink
Hi Jeff,

the exception could be handled, and this issue is well-known - I'll
provide a commented merge request to
https://github.com/jlpainter/turbine-flux.

What might be the case, that not all Turbine security methods OBVIOUSLY
use the org.apache.fulcrum.security.model.turbine.entity interfaces (e.g.
TurbinePermission, TurbineRole,.. ), which might otherwise be used like
this

security.<TurbinePermission>getPermissionByName(permName);

Another caveat we have to be careful with is that there exist at least two
(or even three more with the generated class )

- the required interface
org.apache.fulcrum.security.model.turbine.entity.TurbinePermission
- the OM class provided in Fulcrum Security Torque
org.apache.fulcrum.security.torque.om.TurbinePermission.

What I found is that revoke methods in Fulcrum Security Torque Model seem
to have a bug, as the entry in the relationship table is not deleted.

I already updated Fulcrum Security 1.1.2-SNAPSHOT.

Thanks for your efforts!

Best regards, Georg




Von: Jeffery Painter <***@jivecast.com>
An: Turbine Developers List <***@turbine.apache.org>
Datum: 06.12.2017 21:14
Betreff: Permission DataBackendException error



Hi Georg,

Things are looking much better. I am working on the role/permission
implementation stuff in the flux library. Using your updated Turbine
4.0.1 snapshot and the flux-security snapshot release.

I was trying to figure out what you did to make TurbineUser work to try
and fix issues I am now facing with TurbinePermission, but I have not
dug too deep there yet.

The following method is giving me an exception in the security manager...

Permission perm = security.getPermissionByName(permName);

the exception looks similar to the wrapper issue we had with
TurbineUser...

org.apache.torque.TorqueException:
org.apache.fulcrum.security.util.DataBackendException:
org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl cannot be cast
to org.apache.fulcrum.security.torque.peer.Peer.
The peer class org.apache.turbine.fluxtest.om.TurbinePermissionPeerImpl
should implement interface
org.apache.fulcrum.security.torque.peer.TorqueTurbinePeer
of generic type <org.apache.turbine.fluxtest.om.TurbinePermission>.

The methods for security.getRole() and security.getGroup() seem to be
working fine, just permission is giving me trouble. I will post my
updates soon back to github so you can see where I am stuck.

Also, I submitted an update to the Turbine.java class as the
input.encoding was not getting set properly when trying to put in my own
value in the TR.props file. Hopefully I put the fix in the right place.
It is working for me now and I can once again use UTF-8 encoding :-)

Just wondering if there might be interest in just changing the default
encoding to UTF-8 instead of ISO-8859-1 which is what it is now... not
sure why most would not want to use UTF-8 these days.

Thanks,
Jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@turbine.apache.org
For additional commands, e-mail: dev-***@turbine.apache.org

Loading...