All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: Rights to Downloads Management  (Read 8807 times)

0 Members and 1 Guest are viewing this topic.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Rights to Downloads Management
« Reply #20 on: 16 September 2009, 04:22 »
Beta Test is not a role in WordPress so I have no idea what name is it called.

If you found out this replace the get_role('author') with get_role('name')

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline wangkai

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Rights to Downloads Management
« Reply #21 on: 24 September 2009, 01:25 »
Yes, it is a role I've added with Role Manager where users can register with Reg Level.

I've went in and modified/added the code such as

Code: [Select]
<option value="3"><?php _e('Beta Tester Only''wp-downloadmanager'); ?></option> in download-add.php

Code: [Select]
<option value="3" <?php selected('3'$file->file_permission); ?>><?php _e('Beta Tester Only''wp-downloadmanager'); ?></option> in download-manager.php

as well as the following in wp-downloadmanager.php

Code: [Select]
$role = get_role('beta-tester');
if(!$role->has_cap('manage_downloads')) {
$role->add_cap('manage_downloads');
}

I came up with 3 just randomly, I'm not sure how I can hard code it. (Can't find the function).

Please help. Thanks!

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Rights to Downloads Management
« Reply #22 on: 24 September 2009, 04:43 »
I think you are confused. The code:
Code: [Select]
$role = get_role('beta-tester');
   if(!$role->has_cap('manage_downloads')) {
      $role->add_cap('manage_downloads');
   }
has nothing to do with the file download permission, that code allows the user with role beta-tester to access the wp-admin of downloadmanager.

Your first 2 codes looks ok to me. But having said that, it might or might not work, you have to test it. I don't really provide support for modification of my plugins unless it is a paid job.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline wangkai

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Rights to Downloads Management
« Reply #23 on: 24 September 2009, 07:19 »
I figured it out. :)
RegLevel let's you choose the level for each of the roles that you created.
The -1, 0, 1, 10 in your code is the various level for each of the roles.
So I set the Beta Test as level 3 and then implement the code I've entered here. It's sweet...

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Rights to Downloads Management
« Reply #24 on: 24 September 2009, 07:22 »
Yeap and you added 3 to it, that is why I say it might work because the checking of user level is dynamically so no changes have to be made there.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline LissaE

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: amoment
Re: Rights to Downloads Management
« Reply #25 on: 13 January 2010, 04:41 »
That code is rights to download the file not access WP-Admin of WP-DownloadManager.

In wp-downloadmanager.php

Find:
Code: [Select]
// Set 'manage_downloads' Capabilities To Administrator
$role = get_role('administrator');
if(!$role->has_cap('manage_downloads')) {
$role->add_cap('manage_downloads');
}

Add below it:
Code: [Select]
// Set 'manage_downloads' Capabilities To Author
$role = get_role('author');
if(!$role->has_cap('manage_downloads')) {
$role->add_cap('manage_downloads');
}

Deactivate and activate the plugin again.


Hi, would there be a variation of this code that would allow Authors to be able to add a file only and not have access to the rest of the options? I tried the role manager as well but it also gave permissions for all the options lol

This is a feature I am willing to pay for if necessary and if you have time to do it :)

Lissa

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Rights to Downloads Management
« Reply #26 on: 13 January 2010, 05:21 »
But if you can edit file means you can edit file as well. For add is not a problem. but for edit, the cap will be global. Unless your author wants to add file but can't edit it.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline LissaE

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: amoment
Re: Rights to Downloads Management
« Reply #27 on: 13 January 2010, 06:18 »
I'm not sure I understand lol

I want authors to be able to add files only, I can always edit them if need be but it would be handy for me if they could add the files themselves when they want to post it

When they have global permission they can see all options in the drop down....I don't want anyone to be able to mess with another's files

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Rights to Downloads Management
« Reply #28 on: 13 January 2010, 06:29 »
I charge USD$50 per hour for it, I can do it next week. On my estimate, I will take about 2 to 3 hours to do it.

1. I will add a new cap called "add_downloads" to roles "author", "administrator"
2. I will remove the cap called "manage_downloads to role "author"
3. In downloads-add.php (The page for user to add downloads), I will replace the cap to "add_downloads"

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline LissaE

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: amoment
Re: Rights to Downloads Management
« Reply #29 on: 13 January 2010, 08:22 »
Sounds good to me :)

My next payday is two weeks from Friday so I won't be able to do it financially till then...you have my email from my registration for contact lol :D

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Rights to Downloads Management
« Reply #30 on: 13 January 2010, 09:20 »
contact me when you comfortable with the time =) lesterchan AT gmail

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.