Skip to content

Commit

Permalink
Deny the new token, not 'private' from simple_private_posts.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelietz committed Jan 12, 2012
1 parent 946632f commit e11959a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions membership.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,17 @@ public function field_save( $key, $value )

// create tokens for newly added
foreach( array_diff( $new_tokens, $old_tokens ) as $description ) {
$name = "membership_" . ACL::normalize_token( $description );

ACL::create_token(
"membership_" . ACL::normalize_token( $description ), // prefixed, normalized name
$name, // prefixed, normalized name
$description, // description as entered
"membership" // group = "membership"
);
// Deny the anonymous group access this new token
$anon = UserGroup::get('anonymous');
if ( false != $anon ) {
$anon->deny('private');
$anon->deny( $name );
}
}

Expand Down

0 comments on commit e11959a

Please sign in to comment.