| Previous · Next | |
| User | Message |
|
patspam
|
Date: 7/7/2008 7:40 pm · Subject: The WebGUI_flux branch · Rating: 1
Some of you may have noticed that I've been plugging away at an experimental "WebGUI_flux" branch of WebGUI that JT created for me a month or so ago. I'm happy to say that the code has progressed to the point where I'm ready to announce Flux to the world and invite anyone who is interested to have a play with the demo server, explore the API, give me feedback and if you like the look of it, contribute some plugins of your own.Here's the original impetus for building Flux: As per most content management systems, WebGUI's built-in authorization mechanism is based on User Group membership. This is perfectly adequate for a large class of websites: content managers define one or more User Groups and then set the "Who Can View" and "Who Can Edit" Security Tab options on their Wobjects to the appropriate group. However in one important aspect such sites are static in nature: the set of pages that a user can access is fixed according to what groups they belong to. Authorization can be made dynamic by manipulating group membership (manually, which isn't really dynamic, or via custom code) or by writing custom Wobject authorization logic. Both of these approaches work, however, custom code leaves content managers out of the loop. You can find the latest version of the design doc in SVN in pdf and odt formats. Flux is quite large in scope and hard to condense into a single email, so please refer to the design doc if you want more details, but I'll try to give a quick summary here. For content managers:
For developers:
Imagine you have a WebGUI site with some content that you want to show to your French users only.
Hopefully that gives you a feel for the power of the framework. Be sure to check out the design docs for more details (did I mention it also supports Workflow triggers?). The test suite (in t/Flux) is pretty comprehensive (currently at >85% coverage) - the Operand-specific tests in particular should get you up to speed pretty quickly on how to drive Flux. Test Coverage Report: ---------------------------- ------ ------ ------ ------ ------ ------ ------ File stmt bran cond sub pod time total ---------------------------- ------ ------ ------ ------ ------ ------ ------ lib/WebGUI/Flux.pm 88.1 71.9 50.0 100.0 75.0 2.4 82.3 ...WebGUI/Flux/Expression.pm 93.3 85.7 60.0 89.5 100.0 17.2 89.1 ...lux/Expression/Builder.pm 100.0 n/a n/a 100.0 n/a 0.1 100.0 lib/WebGUI/Flux/Modifier.pm 84.9 61.9 44.4 100.0 100.0 2.9 77.0 ...r/DateTimeCompareToNow.pm 100.0 100.0 n/a 100.0 0.0 0.2 92.6 ...odifier/DateTimeFormat.pm 100.0 50.0 n/a 100.0 0.0 0.3 87.5 lib/WebGUI/Flux/Operand.pm 85.9 66.7 44.4 100.0 100.0 14.7 78.9 .../Flux/Operand/DateTime.pm 100.0 n/a n/a 100.0 0.0 0.2 91.3 .../Flux/Operand/FluxRule.pm 97.1 83.3 n/a 100.0 0.0 1.3 90.0 ...GUI/Flux/Operand/Group.pm 100.0 n/a n/a 100.0 0.0 0.1 90.5 ...x/Operand/NumericValue.pm 100.0 n/a n/a 100.0 0.0 0.1 89.5 ...Flux/Operand/TextValue.pm 100.0 n/a n/a 100.0 0.0 0.6 89.5 ...lux/Operand/TruthValue.pm 100.0 n/a n/a 100.0 0.0 0.1 89.5 ...erand/UserProfileField.pm 100.0 n/a n/a 100.0 0.0 0.1 90.5 lib/WebGUI/Flux/Operator.pm 84.5 53.1 33.3 100.0 100.0 14.5 75.0 ...oesNotMatchPartialText.pm 100.0 n/a n/a 100.0 0.0 0.1 95.5 ...lux/Operator/IsEqualTo.pm 100.0 100.0 100.0 100.0 0.0 1.8 96.6 ...Operator/IsGreaterThan.pm 100.0 100.0 100.0 100.0 0.0 0.2 96.6 ...IsGreaterThanOrEqualTo.pm 100.0 100.0 100.0 100.0 0.0 0.2 96.6 ...ux/Operator/IsLessThan.pm 100.0 100.0 66.7 100.0 0.0 0.2 93.1 ...or/IsLessThanOrEqualTo.pm 100.0 100.0 100.0 100.0 0.0 0.2 96.6 .../Operator/IsNotEqualTo.pm 100.0 100.0 100.0 100.0 0.0 0.2 96.6 ...tor/MatchesPartialText.pm 100.0 n/a n/a 100.0 0.0 0.1 95.5 lib/WebGUI/Flux/Rule.pm 94.9 88.9 84.4 93.3 93.8 42.4 92.3 Total 93.1 75.7 70.2 97.8 53.2 100.0 87.4 ---------------------------- ------ ------ ------ ------ ------ ------ ------ Implementation status:
You can also download the latest version of the code from SVN and run it yourself - be aware that visualisation of the Flux Graph is currently done using GraphViz so you will need to install it on your system using something similar to "apt-get install graphviz gsfonts" and "cpan GraphViz". The big caveat for getting Flux included in a future version of WebGUI is performance. Obviously checking Flux Rules is more expensive than doing a single call to $user->isInGroup(). I've done quite a bit of work on benchmarking, profiling and optimisation, and so far things look good but there's still work to be done. I'll save that discussion for a later email. I'm looking forward to your feedback. Anyone who wants to get involved please don't hesitate to drop me a line or ping me on IRC. I'll also be at the WUC if you want to talk to me about Flux in person. Cheers, Patrick (aka patspam) Attached Files |
| Back to Top |
Rate [ | ]
|
|
JT
|
Date: 7/8/2008 10:40 am · Subject: Re: The WebGUI_flux branch · Rating: 0
We're going to have to come up with another way to tie this into the privileges system than the way you've done it so far. The way it appears to work now will require adding an extra flux privilege field for every other privilege field in the system. That's both bulky and difficult to maintain. I don't have an answer for this off the top of my head, but I'll think about it and we can discuss at the WUC. |
| Back to Top |
Rate [ | ]
|