List Info

Thread: Blog API module permissions




Blog API module permissions
country flaguser name
United States
2007-12-20 00:15:55
Hi, I'm not really sure whether this is the right place to
send this, so
feel free to point me in the right direction if not.

I discovered that the Blog API module (core - optional)
lacks an
implementation of hook_perm, making it impossible to use for
any user
other than UID 1.  Found running Drupal 5.3, btw. 
Thankfully (as I am
very very new to both Drupal and PHP), this was easy to fix.
 All that
needs to be done is to insert the following into the
blogapi.module file
somewhere (custom seems to suggest immediately after
hook_help?):

/**
 * Implementation of hook_perm().
 */
function blogapi_perm() {
  return array('edit own blog');
}

-- 
 - Tony Yarusso
http://tonyyarusso.com/
Re: Blog API module permissions
country flaguser name
United States
2007-12-20 01:22:39
On Dec 19, 2007, at 10:15 PM, Tony Yarusso wrote:

> I'm not really sure whether this is the right place to
send this, so
> feel free to point me in the right direction if not.

The core issue queue would be best:
http:
//drupal.org/node/add/project-issue/drupal

> I discovered that the Blog API module (core - optional)
lacks an
> implementation of hook_perm, making it impossible to
use for any user
> other than UID 1.
> ...
> /**
>  * Implementation of hook_perm().
>  */
> function blogapi_perm() {
>   return array('edit own blog');
> }

Hrm.  Well, oddly, blogapi.module *does* refer to this
permission,  
which is defined in blog.module.  Seems there's some unholy 

dependencies between the two.  I've never looked at either
module  
until just now to grep for this, so I'll leave it to someone
more  
familiar with how these 2 are supposed to interact to either
justify  
the status quo or propose the right solution.  Either way,
that  
should happen in the issue queue, not here. ;)

So, please, create an issue for this, and send us a link
with the  
node id, and then folks can reply there as appropriate.

Cheers,
-Derek (dww)




Re: Blog API module permissions
user name
2007-12-20 02:50:05
On Dec 20, 2007 8:22 AM, Derek Wright <drupaldwwright.net> wrote:
> Hrm.  Well, oddly, blogapi.module *does* refer to this
permission,
> which is defined in blog.module.  Seems there's some
unholy
> dependencies between the two.  I've never looked at
either module
> until just now to grep for this, so I'll leave it to
someone more
> familiar with how these 2 are supposed to interact to
either justify
> the status quo or propose the right solution.  Either
way, that
> should happen in the issue queue, not here. ;)

AFAIR there are other cross-dependencies as well. I noticed
some while
testing user login with blog api. So the migration to
"any content
type support" in blogapi module might not have been
complete. I did
not have the time to investigate this though.

Gabor

Re: Blog API module permissions
user name
2007-12-20 11:40:05
2007/12/20, Derek Wright <drupaldwwright.net>:
>On Dec 19, 2007, at 10:15 PM, Tony Yarusso wrote:
>>I'm not really sure whether this is the right place
to send this, so
>>feel free to point me in the right direction if
not.
>
>The core issue queue would be best:
>http:
//drupal.org/node/add/project-issue/drupal

And have a look at http://drupal.org/node/5
4055 to see if that's
related to your problem.

>>I discovered that the Blog API module (core -
optional) lacks an
>>implementation of hook_perm, making it impossible to
use for any user
>>other than UID 1.
>>...
>>/**
>> * Implementation of hook_perm().
>> */
>>function blogapi_perm() {
>>  return array('edit own blog');
>>}
>
>Hrm.  Well, oddly, blogapi.module *does* refer to this
permission,
>which is defined in blog.module.  Seems there's some
unholy
>dependencies between the two.  I've never looked at
either module
>until just now to grep for this, so I'll leave it to
someone more
>familiar with how these 2 are supposed to interact to
either justify
>the status quo or propose the right solution.  Either
way, that
>should happen in the issue queue, not here. ;)

The status quo is definitely not justifiable, but (probably)
too much
work to be worth messing with at this stage of D6. Come D7
and we'll
see what happens. ;) (I do have plans to look deep(er) into
BlogAPI
for D7.) See below.

>So, please, create an issue for this, and send us a link
with the
>node id, and then folks can reply there as appropriate.

There's an old (dare I say ancient (4.7b6)?) issue here:
http://drupal.org/node/5
4055 - including a patch by yours truly. It's
not exactly what Tony described, but it certainly does sound
related.
I came to an agreement (initially with meself) that the
patch is only
a shallow fix for the issues with this module, but also that
a
complete refactoring would probably end up going beyond the
code
freeze... so that part's put off for D7.

-- 
Frederik 'Freso' S. Olesen <http://freso.dk/>

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )