I would like to be able to set a global setting for the access control default setting.
I would also like a global setting to show or hide the access control box, so that users would not have the ability to change the setting.
Example: right now, the default setting is to allow open access, and users have to manually set it if they want to only display it to their friends. I want to be able to switch that on my site so that it defaults to restricting access to only friends. In addition, I want to be able to hide the access control setting, so all nodes are always restricted to view only by friends.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | default_access_setting-1107544-1.patch | 2.64 KB | shawn dearmond |
Comments
Comment #1
sirkitree commentedHow do you propose exposing these settings?
Comment #2
shawn dearmond commentedHere's a patch.
It puts the checkboxes in admin/structure/flags/manage/friend.
However, the way I did it was to save the settings as variables. It works, but I'm thinking there's a better way by storing it in the cached flag object itself.
Comment #3
shawn dearmond commentedArgh! I can't figure out how to add more properties to the $flag object and have them stick. I think it has something to do with adding more stuff to $flag->options(), but I can't figure it out.
Comment #4
sirkitree commentedYea, I think we'd have to a get a little Object Oriented for this.
something like:
but that's totally pseudo code and I've not written much OOP stuff myself, though I understand it in practice.
Maybe post what you've gotten so far in a code block and we can brainstorm a bit?
Comment #5
shawn dearmond commentedWhat I've done so far is in patch #2. But it just uses system variables, which I think is a little kludgy. I thought about building a child class, but wouldn't that result in rewriting much of the original module?
Comment #6
moonray commentedYou would probably need to alter the flag module (not just flag_friend).
Considering that, I would say the patch in #2 is the way to go.