-
Notifications
You must be signed in to change notification settings - Fork 24
different behavior for different kinds of groups (subtypes) #54
Comments
We added "coauthors", "team", and "buddies" group subtypes in f9daa18 -- we still need to get all of the interactions around these different types set up right. (I've moved other old parts of this ticket into a new UI Cleanup item, namely #144.) Note: I'm still not 100% clear on whether we actually need a "buddies" subtype or not. In any case, I think we do need to distinguish them in some way, and they should not go into the general-purpose listing of groups if we can help it. |
The interactions are there now: the final step is to get the permissions sorted out within the OG backend. |
It's worth noting that none of the group code will work properly unless this code is run through devel/php after the profile runs. |
In order to set up permissions properly, one needs to use But, it's also possible to disable the og_field_access module in order to give access to all fields (and we can use some other criteria to provide access to nodes?). |
This all seems to be working now. As a note for the future, if we want to actually have different kinds of permissions (which it turns out we don't need so far) then we should create another group content type (not "subtype"), and revise the logic throughout accordingly. For example, we might want to do this if we were to create fully private collaboration spaces. I figured out how to tell the difference between "buddy lists" and "teams" when doing the migration from the old site -- just need to test that and commit. |
Note: this is the query that is used to get the planetmath groups (ideally we would only import the groups that are actually USED for something: this query leaves us only with groups that are not trivial): -- first attempt
SELECT * from ( SELECT COUNT( planetmath_group_members.userid ) AS cnt,
planetmath_group_members.groupid
FROM planetmath_group_members
GROUP BY planetmath_group_members.groupid ) as t WHERE t.cnt > 1; This improves the above to give us the information we actually need, so it's what we use: -- second attempt
SELECT t.groupid, pmg.userid, pmg.groupname, pmg.description
FROM planetmath_groups pmg,
( SELECT COUNT( planetmath_group_members.userid ) AS cnt,
planetmath_group_members.groupid
FROM planetmath_group_members
GROUP BY planetmath_group_members.groupid ) as t
WHERE t.cnt > 1
AND pmg.groupid = t.groupid; We can separate out "default groups" from custom groups by adding another line that checks whether -- third attempt
SELECT t.groupid, pmg.userid, pmg.groupname, pmg.description
FROM planetmath_groups pmg,
( SELECT COUNT( planetmath_group_members.userid ) AS cnt,
planetmath_group_members.groupid
FROM planetmath_group_members
GROUP BY planetmath_group_members.groupid ) as t
WHERE t.cnt > 1
AND pmg.groupid = t.groupid
AND planetmath_groups.description LIKE 'This is the default group for user%'; |
This appears to be working now. |
There are some other complexities, i.e. we want different kinds of behavior for different kinds of groups:
New teams should show up in the "Everything Else" box, but new coauthor groups and buddy lists should not.
Note: Although they are not "teams", collections are in some ways similar to teams: they just collect content, instead of people+content. See #131 for details on collections.
The text was updated successfully, but these errors were encountered: