Hello

Is there a way to hide the "Group settings" tab field title on nodes from users who don't have permissions to assign a node to a group? Currently the permissions work fine, it's just that the field is empty and the tab title remains.

I'm thinking I could probably alter the form to unset the field based on a user's role, but wanted to see if there was recommended way to achieve this.

Thanks!

Comments

pilch57’s picture

Issue summary: View changes
kristiaanvandeneynde’s picture

Category: Support request » Bug report

Seeing stuff you can't interact with sounds like a bug.
Will look into it once my schedule doesn't require 48 hours in a day :)

juagarc4’s picture

Hello,

May be adding a new permission it's a good form to do it.
I've made a path for it.

ctrladel’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.4 KB
new27.04 KB

This issue probably doesn't call for a new permission. If we take a look at the current state of how the group field is displayed on node creation
Table showing the various permissions and resulting display for node creation with group

The original issue is probably about case 5 or 9 where the user can only create global nodes but an empty select box is still shown on the node creation page. Checking if the options for the group field are empty and if it is then unsetting the form element for group is all that's needed to fix this issue. I've attached the patch to do that.

While running through all the cases I came across a couple other issues that could be addressed.

  • Group permissions probably shouldn't enable the /node/add/% path as in cases 2,3,4,10. A setting for gnode to decide if it does would probably be best.
  • The select in case 3 should autoselect if there is only one option(not in case 6 because the field is not required then).
  • The group field should probably only be an autocomplete if the choices for groups are >10 or so and a select if there are < 10 options, regardless of what roles the user has.
  • The 'bypass group access control' permission allows a user to create all content types as long as they assign it a group. The permission is working exactly as intended but it should probably be fine tuned to limit it to only content types that can be created within groups.
kristiaanvandeneynde’s picture

Very helpful feedback and patch Vulsutyr! I'll try to look into it asap.

Group permissions probably shouldn't enable the /node/add/% path as in cases 2,3,4,10. A setting for gnode to decide if it does would probably be best.

If I recall correctly, this is out of my hands because Group Node provides node creation access through the access system defined by Node. Because of this, people will have access to the node creation paths defined by Node.

I could try to unplug Group Node from the create rights seeing as we have a dedicated Group Node creation path. This could lead other Node access modules to freak out, though, because we're not being 100% honest about node creation access then.

The select in case 3 should autoselect if there is only one option (not in case 6 because the field is not required then).

Good UX improvement, agreed.

The group field should probably only be an autocomplete if the choices for groups are >10 or so and a select if there are < 10 options, regardless of what roles the user has.

Hmm, somewhat agreed. Could be annoying if the user doesn't know all the groups he is in.

The 'bypass group access control' permission allows a user to create all content types as long as they assign it a group. The permission is working exactly as intended but it should probably be fine tuned to limit it to only content types that can be created within groups.

Nice catch! The problem is that the group permission system is completely bypassed by that permission (duh :-) ). I could perhaps make it the same like Subgroup: showing the permissions with a warning that you still need to enable the node types under the group type's config.

johnennew’s picture

The original issue is solved by the patch in #4 so I am setting to RTBC.

The larger patch at the URL below also solves this and possibly a number of the other issues. I am going to go through each of the other items listed above and create new issues for each.

#2317195: Allow more than one parent by node / subgroup

johnennew’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #4 fixes the issue.

johnennew’s picture

The select in case 3 should autoselect if there is only one option (not in case 6 because the field is not required then).

This is added in #2317195: Allow more than one parent by node / subgroup

johnennew’s picture

The 'bypass group access control' permission allows a user to create all content types as long as they assign it a group. The permission is working exactly as intended but it should probably be fine tuned to limit it to only content types that can be created within groups.

Created new issue to deal with this #2600084: Restrict which node types can be added to groups

Pierre.Vriens’s picture

@Kristiaan: where does this issue fit in the 7.1.0 roadmap? Can you add it please in the appropriate spot in that (meta) issue? @CtrlADel: can you think of something to fix the broken link in comment nr 4 (the png file still exist though)?

kristiaanvandeneynde’s picture

Oh wow, I must have lost track of this one. I'd say this one should be reviewed after the patch from #2317195: Allow more than one parent by node / subgroup goes in. It may need a reroll or will be fixed by the changes made in that issue.

Thanks for spotting this Pierre!

ctrladel’s picture

Fixed the image, it was pointing to the wrong file name some how.

Pierre.Vriens’s picture

Kristiaan, WHEN do you think that patch you mentioned in #11 will go in? Reason why I ask: finalize D7 release ...

Pierre.Vriens’s picture

pribeh’s picture

Anybody able to add in a weight function while you're at it (or should that be a separate issue)?

noopal’s picture

Hi, I still have this issue with current release.

In my group permissions I have only 1 node type where I have selcted create content in group. But when a user with that permission is creating a node of any type the Parent group field shows on the node edit/creation form. Looks really messy.

How can I remove this field on pages where it is not applicable?

Thanks

kristiaanvandeneynde’s picture

Component: Group Node (gnode) » Code
Status: Reviewed & tested by the community » Closed (outdated)

The Drupal 7 version is no longer supported, cleaning up the issue queue.