Role-based enabling of features

104 views
Skip to first unread message

Andreas Schoendorfer

unread,
Dec 3, 2012, 12:55:36 AM12/3/12
to togglz...@googlegroups.com
Hi there

Is there any possibility to enable features based on the roles of a user, not the user (name) itself? This would be helpful, as in our production environment the user roles are defined by our client (not only for features controlled by togglz), and so they would have the possibility to define their test groups for new features by themselves.

In my opinion there should be a configuration like:

# The feature 'FEATURE_ONE' is enabled for the users 'admin' and 'betatester'
FEATURE_ONE=true
FEATURE_ONE.roles=ROLE1,ROLE2

Thanks
Andreas

Christian Kaltepoth

unread,
Dec 3, 2012, 5:50:06 AM12/3/12
to togglz...@googlegroups.com
Hi Andreas,

unfortunately Togglz current doesn't provide direct support for user groups or roles.

But I'm currently working on a new feature for Togglz 1.2.0 that will allow users to implement custom strategies for activating features. This new SPI can for example be used for gradual rollouts (for a certain percentage of users), location-based rollouts (incrementally for certain countries) and much more.

You can have a look at this thread to get a general idea what will be possible with 1.2.0:


Especially the first draft of the new SPI for providing custom activation strategies could be interesting for you:


I'm nearly finished with the implementation. I think the custom strategy support will be available in the snapshots by the end of this week. And I think that the release of Togglz 1.2.0 will follow very soon.

Feel free to post on the list if you have any questions or feedback regarding the new API. :)

Best regards

Christian


2012/12/3 Andreas Schoendorfer <andreas.sc...@gmail.com>

Andreas

--
 
 
 



--
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal


Andreas Schoendorfer

unread,
Dec 6, 2012, 2:34:37 AM12/6/12
to togglz...@googlegroups.com
Hi Christian

I visited the thread you posted in your reply, and this sounds great. With a custom strategy implementation we will easily be able to enable features based on user roles.

So I'm looking forward to your next version 1.2.0.

Thanks
Andreas

Christian Kaltepoth

unread,
Dec 6, 2012, 11:48:35 AM12/6/12
to togglz...@googlegroups.com
Hey Andreas,

thanks for your feedback. Would you perhaps like to give the snapshots a try after I finished the implementation? I would love to know if the API works good for real world examples before releasing 1.2.0. :)

Best regards

Christian


2012/12/6 Andreas Schoendorfer <andreas.sc...@gmail.com>

Andreas Schoendorfer

unread,
Dec 10, 2012, 2:33:24 AM12/10/12
to togglz...@googlegroups.com
Hi Christian

I have to look if i can use togglz in the project i'm currently working on. If this is the case, i will try to implement a role-based enabling of feature based on your version 1.2.0. Please send a short info if your implementation is ready.

Andreas

Christian Kaltepoth

unread,
Dec 10, 2012, 2:42:56 AM12/10/12
to togglz...@googlegroups.com
Hey Andreas,

OK, great. I will notify you as soon as the snapshots are ready. :)

Christian


2012/12/10 Andreas Schoendorfer <andreas.sc...@gmail.com>

Andreas Schoendorfer

unread,
Feb 7, 2013, 4:00:03 AM2/7/13
to togglz...@googlegroups.com
Hi Christian

do you have any idea about when to release version 1.2?

thanks
Andreas

Christian Kaltepoth

unread,
Feb 7, 2013, 11:29:35 AM2/7/13
to togglz...@googlegroups.com
Hi Andreas,

I'm really sorry. I know I promised to get the next version out some time ago. Unfortunately I was very busy in the last two months.

But the implementation of the new feature activation mechanism is finished. I just need some time to clean up the code and give it a try in some of my applications.

Perhaps I'll publish a something like 1.2.0.Alpha1 next week. Would this help you? I would love to get some feedback for the next version before fully releasing it, because it contains some major changes to the internals that I cannot change anymore after releasing 1.2.0.Final. Therefore I want to make sure everything works fine. :)

Christian


2013/2/7 Andreas Schoendorfer <andreas.sc...@gmail.com>
--
 
---
You received this message because you are subscribed to the Google Groups "togglz-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to togglz-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Christian Kaltepoth

Christian Kaltepoth

unread,
Mar 4, 2013, 3:42:06 AM3/4/13
to togglz...@googlegroups.com
Hey Andreas,

sorry for the delay. But I've finally some good news for you. I released Togglz 2.0.0.Alpha1 this weekend. I decided to call the next version 2.0.0 instead of 1.2.0 because of the API changes with this release.

There haven't been an official announcement yet, but you can download the new version from the Togglz homepage [1], get the artifacts from Maven Central [2] and have a look at the javadocs [3].

To activate features based on user roles, you have to implement a custom ActivationStrategy [4]. This should be straight forward. Just have a look at the existing implementations to get a general idea on how this works.

One small warning. Due to the major changes to the API, Togglz will migrate the format of the persisted feature state (in the properties file or in the database table) to a new format. This will be done automatically for you. However this has one drawback. You cannot go back to Togglz 1.1.x after this migration anymore. So if you want to give 2.0.0.Alpha1 a try, you should backup the properties file and/or database table.

One more thing. I know that "Alpha1" sounds like this version of Togglz isn't stable yet. But actually I think this version is very stable. I just named it Alpha1 because I want to get some community feedback regarding the APIs. So APIs _may_ change in the final version. But I think if there are changes, they won't be very big. I'm pretty happy with the API right now. The overall stability of 2.0.0.Alpha1 is great. We've even more integration tests compared to 1.1.0.Final. I for myself will start to update some of our production applications to 2.0.0.Alpha1 today. :)

I'm looking forward to your feedback. :)

Best regards

Christian


[1] http://www.togglz.org/download.html
[2] http://search.maven.org/#search%7Cga%7C1%7Ctogglz
[3] http://www.togglz.org/apidocs/2.0.0.Alpha1
Reply all
Reply to author
Forward
0 new messages