I'm wondering about best practice, and if I'm setting myself up for trouble.
The goal: Limit an editor's Safecracker access to specific entries within a channel, based on the member group of the editor.
The setup: I'm using Zoo Visitor for members as channel entries. Thinking of using categories to limit Safecracker access within a channel.
An example: my_member_channel has an entry named Dan, who is in my_editors member group. Dan needs to be able to edit other users in the my_member_channel that have the category "Editor Category" selected, but no others.
This seems to work:
{exp:channel:entries channel="my_member_channel" limit="1"}
{categories}
{if category_id == 1 && (member_group == '6' || member_group == '8')}
{!--
If the category "Editor Category" (1) is selected, and the logged in user is in my_standard_admin (6) or my_editors (8) member group.
--}
{exp:safecracker
channel="my_member_channel"
entry_id="{segment_3}"
}
Various fields in the channel to be edited here,
including a Matrix field with a Playa column:
{field:my_matrix_field}
submit button
{/exp:safecracker}
{/if}
{/categories}
{/exp:channel:entries}
I tested this lightly, but it seems to work fine. So if I continue down this route I'll create "pseudo member categories" to be used in various channels and then conditionally check before showing the Safecracker form.
Am I missing a much more stable approach? I would prefer doing this all using the CP, but can't seem to work out a way to dole out the permissions in a custom enough way, therefore Safecracker.