Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
Hide Namespaces in Media Manager
If user doesn't have Upload perms for that namespace
Avatar
Sherri #1
Member since Oct 2007 · 19 posts · Location: Ontario, Canada
Group memberships: Members
Show profile · Link to this post
Subject: Hide Namespaces in Media Manager
Hi,

I have set up namespaces in such a way that each of my clients has it's own namespace. Ideally they should not be able to see eachother's namespace or what other namespaces exist on the wiki.

However, when they upload a file to their namespace, the list of all namespaces shows up on the right of the Media Manager.

Does anyone know if there is a way, maybe a mod, to only list the namespaces for which the user has Upload perms for that namespace? Actually, when inserting an image they would have to see the spaces for which they have read perms, and for uploading they would have to see the ones for which they have Upload perms.

Or, maybe a good compromise would be to show all namespaces they have Read perms for, then if they don't have upload perms for that NS then I assume the Media Manager will block the upload anyway?

Thanks!!
Avatar
Sherri #2
Member since Oct 2007 · 19 posts · Location: Ontario, Canada
Group memberships: Members
Show profile · Link to this post
Well, if I can't get help, I tend to solve things myself. ;)

For anyone interested, here's how to hide namespaces in the Media Manager for which the user does not have at least Read permissions:

In the file inc/media.php: in function media_nstree($ns){, add this before the echo statements:

    // Remove namespaces for which user does not have at least read perms.
    foreach($data as $key => $namespace){
        if(auth_quickaclcheck($namespace['id'].":*") < 1){
            unset($data[$key]);
        }
    }
Avatar
ach (Moderator) #3
Member since May 2006 · 544 posts
Group memberships: Global Moderators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
In reply to post #1
Quote by Sherri on 2009-06-17, 21:11:
Or, maybe a good compromise would be to show all namespaces they have Read perms for, then if they don't have upload perms for that NS then I assume the Media Manager will block the upload anyway?

You can activate the *sneaky_index* config option (http://www.dokuwiki.org/config:sneaky_index). That does not only restrict the index, but also the file tree in the media manager if the user has not at least read permissions.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please note the verification code from the picture into the text field next to it.
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20090606-dev, © 2003-8 by Yves Goergen
Current time: 2010-03-19, 17:58:11 (UTC +01:00)
WikiForumIRCBugsGitXRefTranslate