Forums / Cotonti / Support / Custom Plugin to be accessed by Moderator

medj
#1 2009-02-16 15:21
Hey everyone, I would have asked this on neocrome forums, but I tend to get slow response. I hope this question will be simple for you guys to answer, but I can't figure out why this won't work for me.

First of all, I am using Seditio.
I made a plugin for my site and it has a setup field in the admin of the plugin to change some HTML code.

I even changed the Auth settings in the setup.php file to enable moderators of the site to be able to change this HTML code, or so I thought.

Even though the plugin has Moderator admin privileges, my moderators are not able to access this plugin.

Can anyone offer any insight on this?

Thanks.
Trustmaster
#2 2009-02-16 15:44
Do you call sed_auth() correctly in it?
May the Source be with you!
medj
#3 2009-02-16 16:10
Okay, I'll be honest, I don't know exactly what you mean by that.
Is this something I should be calling in the setup file or in the main file?

By the way, I have these in the setup.

Auth_guests=R
Lock_guests=RW12345A
Auth_members=RW
Lock_members=12345

I just duplicated the settings from another plugin.
Trustmaster
#4 2009-02-16 21:41
I mean you need to check A permission for that action manually:
if(sed_auth('plug', 'yourplugin', 'A'))
{
  // Some actions here
}
else
{
  // You are not allowed to do this
}
May the Source be with you!
medj
#5 2009-02-17 01:48
Hmm, I think I didn't explain good enough.

My plugin works fine in terms of how it works on my site and I'm also able to edit the field in my admin panel in the plugins category.

The only thing I was hoping to do was give the Group "Moderators" to be able to go into the admin panel and edit this one plugin. Specifically to edit the text field which I made using the code below in the setup file:

[BEGIN_SED_EXTPLUGIN_CONFIG]
feature=01:text:::This is the HTML code for the announcement box
[END_SED_EXTPLUGIN_CONFIG]

From what you wrote above, I think you thought that I wanted a certain thing to show on the site for moderators.

I would almost go as far as to say that there could be a bug here only because I have the privileges set so that Moderators should be able to edit "admin" the plugin yet access is still blocked to the plugin page from a Moderator level.

Thanks for your reply though.
Trustmaster
#6 2009-02-17 03:10
That is quite tricky and it is not possible to give access to a specific plugin configuration. What is usually done in this case, is a special editor in the plugin itself, and all the checks are performed in code.
May the Source be with you!
medj
#7 2009-02-17 05:44
So when you click on the rights of a plugin and you see Administrator, Moderator, Member, etc. with all the checkboxes for Read, Write and Admin privileges, what exactly is the point of all this?
Kilandor
#8 2009-02-17 14:35
Correct you can't give someone specific access to anything in admin right now, either they get access to everything, or nothing.

For plugins W/A(1-5) do nothing unless you code them to.
Read, allows users to access the plugin, if they do not have atleast R, the hook/plugin will not load for them.

But you can create a standalone plugin, and use a SQL query to update the config.
That is the only way to allow someone to modify a config without giving them access to the admin panel.
medj
#9 2009-02-20 02:02
Okay, thanks for the help guys.
I figured out an alternative method to let my staff edit a part of the site by just including a certain file in another folder.

By the way, does cotonti have the ability to do what I was explaining above?