
Merge methods to find users for a given site and role
Reported by Clemens Kofler | October 1st, 2008 @ 10:39 AM | in Release 0.1.0
To implement #11 I created the method User#find_all_by_site_and_role (see this commit) which behaves similarly to the existing method Site#find_users_and_superusers. Sven therefore suggested to merge them by providing a way to pass the desired role(s) to #find_users_and_superusers (e.g. :roles => :moderator).
This should definitely be done in order to avoid duplicate functionality.
Comments and changes to this ticket
-
Clemens Kofler October 5th, 2008 @ 09:40 PM
- Assigned user changed from Sven Fuchs to Clemens Kofler
- State changed from new to open
- Milestone set to Sprint #2
-
Clemens Kofler October 6th, 2008 @ 01:15 PM
For now, I think it makes sense to not merge these two methods because one (find_users_and_superusers) is about site memberships whereas the other (find_all_by_site_and_role) is about roles/permissions.
I improved find_all_by_site_and_role to support all contexts (not only sites) and renamed it to by_context_and_role. In the future, there's several things that could be done here:
- Make it into a named scope.
- Allow to pass multiple roles (e.g. User.by_role(forum, [:moderator, :forum_admin]).
- Allow some kind of object-based delegation (e.g. User.by_role(forum, :moderator) checks if forum.respond_to?(:moderators) and then calls forum.moderators) and if the delegation method can't be found it continues "standard" execution.
-
Sven Fuchs October 13th, 2008 @ 11:01 AM
- Milestone changed from Sprint #2 to Release 0.1.0
-
Sven Fuchs January 9th, 2009 @ 11:13 AM
- State changed from open to resolved
i think we can close this ... gotta figure out how to do these lists in context of "real" apps
-
Alyssia Huber December 26th, 2020 @ 08:17 AM
Get your elf and login to this account to get the time to time updates. The content they share on this blog is always unique and worthy enough and now they can get bestdissertation service to finish their tasks. To be effective enough for such kind of amazing content to read and share with others to also let them aware of it.
-
LarryMorgan January 13th, 2022 @ 12:37 PM
Assignment Help Service is a well-known Coursework Help company that provides skilled essay writers to students from all around the world, assisting them with writing difficulties. The website has established itself as the most promising dissertation help online during the course of its more than ten years of existence. You may contact them if you need help with any academic work.
-
Noah Wilson September 22nd, 2022 @ 01:38 AM
I haven't read anything like this in a very long time. Although I frequently encounter the sophisticated use of terminology when I provide students with Homework Help such as Economics Homework Help.
-
ava james March 13th, 2023 @ 10:41 AM
Nice ticket thanks for sharing this. I am glad to see it. lightinthebox discount code
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<p>Cutting edge cms, blog, wiki, forum ... plattform.</p>
<p>Find the code on <a href="http://github.com/svenfuchs/adva_cms/tree/master">GitHub: adva cms</a></p>
<p>Part of the business application framework <a href="http://www.advabest.org/">adva best</a>.</p>