Can't hide block/content for a group

Permalink
i have a page where if the user is logged in and assigned to a certain group, i actually want to hide certain content from them. I have adv. permissions tuned on, added the user to the group and then set the permissions for that group. i added that group and set block specific permissions for a piece of content and said i don't want them to read/write or delete. So i was hoping concrete5 would hide that block when i'm logged in as that user, but no dice. It also doesn't save that i added that group to the block level permissions--it doesn't show up at all.

Any ideas? Is this a bug?

fregas
View Replies:
mkly replied on at Permalink Reply
mkly
I alway gets confused when people describe their permissions but if I understand you(and seeing that you are a .NET fellow), are you attempted set subtractive permissions. Meaning DENY?

If you were then I would unfortunately have to tell you that there are not subtractive permissions AFAIK in Concrete5. You can't DENY a particular group, you can only not add them. Hope that makes sense.

That said...
You can kind of fake it in this case by doing it inside your theme.
Like if you could do
<?php
  $grp = Group::getByName('My Group');
  $u = new User();
  if(!$u->inGroup($grp)) {
    $a = new Area('Sidebar');
    $a->display($c);
  }
?>

for a particular area.
fregas replied on at Permalink Reply
fregas
yes, exactly. I'm trying to subtract permissions for a group.

this begs the question then...what is the point in having a "Read" column in the block permissions when you cannot in fact remove access? It seems like everyone has read access by default and you cannot remove read access. So what is the point of having that column with that checkbox? If you check it or not it will be the same behavior.
mkly replied on at Permalink Reply
mkly
There have been some discussions of that being added at some point.

That said, yes looking at that form, it is little confusing. I guess to give you a possible situation. For example if you wanted everyone in the "Administrators" group to have permission to "Read" that block and not "Guests" then if you added and checked the "Administrators" and unchecked "Guests" then those in the "Administrators" group could "Read" the block but "Guests" cannot.

Although, you may be talking about something I haven't actually noticed.
fregas replied on at Permalink Reply
fregas
Yeah thats also confusing. Deselecting the "Read" column does work with "Guest" or unregistered users. Just not with any other group. That doesn't make much sense. I can see a lot of scenarios where you want to show/hide content based on the group the user is in.
mkly replied on at Permalink Reply
mkly
Hmmm. I just tested that with two different groups and it did only show it to the one group I included. Hopefully we aren't confusing each other. If you select "Registered Users" then everyone who is logged in can see it regardless of what else is checked. If you only want one group to be able to see it uncheck everyone's read access including "Registered Users" except that one group. Also, the admin "Super User" can still always see everything no matter what the perms AKAIK.
fregas replied on at Permalink Reply
fregas
So I have a group called "parents" that i do NOT want to see the content when they are logged in. I DO want guests to see it.

I have unchecked "registered users" for read access. I have "parents" unchecked also. I have guests checked. So when i'm logged out, i see the text, but when logged in as a parent, i still see it.
mkly replied on at Permalink Reply
mkly
I think that's kind of the misleading additive part. I think "Guests" are really just "Everyone". And "Registered Users" is "Everyone who is logged in". So if either of those are checked it really won't matter what groups anyone is or isn't in because they _already_ have permissions to read it no matter what the group perms are.
fregas replied on at Permalink Reply
fregas
i see. So there is no way to include guest/non-logged in users but exclude a certain group, because they all inherit permissions from guests.

I may go the add-on route that John mentioned but it would be nice to have this ability for all blocks, not just content.
JohntheFish replied on at Permalink Reply
JohntheFish
There is a content block derivative that may do this for you (if what you want to show/hide will fit in the block:

http://www.concrete5.org/marketplace/addons/targeted-content/...
Responsive replied on at Permalink Reply
Responsive
Anyone know if this will be fixed on the improved advanced permissions ie when logged in the Guest access level still applies.

I have the problem to hide a block when logged in. User logs in and is member of a group called Demo which should not be able to see the block, but they still can as they are still a Guest.