Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

How to remove sink option from back end ?

I want to remove sink option from back end in user role & permission and from edit category section. How can i do it?

Tagged:
«1

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited May 2014

    The easiest way is to create a style sheet called customadmin.css and add it to your theme. Or add this to the admin.css

    .CheckBoxGrid td input#Form_Permission38{
    display:none;
    }

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator
    edited May 2014

    Permissions are set with PermissionModels function Define and there also is a function Undefine. I guess you could try something like that in a plugin:

    function Setup() {
       $PermissionModel = new PermissionModel();
       $PermissionModel->Undefine('Discussion.Sink');
    }
    

    and reverse that in the function OnDisable

    But I'm not sure that this won't break anything...


  • deepusdeepus New
    edited May 2014

    Thank you vrijvlinder for your valuable reply and it is helpful. Thank you. Which is the view file which contain the sink option.? It will be help full for further works.

    vrijvlinder
  • Where can i find

    function Setup() {
       $PermissionModel = new PermissionModel();
      // $PermissionModel->Undefine('Discussion.Sink');
    }
    
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator
    edited May 2014

    The path you see in your browsers address bar is /role/edit/X and it is part of the dashboard. So you can find the view in /applications/dashboard/views/role/edit.php
    Yes, Vanilla is that easy! :)

    But don't change core files!


  • R_JR_J Cheerleader & Troubleshooter Munich Moderator
    edited May 2014

    @deepus said:
    Where can i find

    Nowhere. You would have to create either a theme hook (don't know much about that) or a plugin.

    <?php if (!defined('APPLICATION')) exit();
    
    $PluginInfo['NoSink'] = array(
        'Name' => 'NoSink',
        'Description' => 'Removes sink permission',
        'Author' => 'Glorious Nonsense Plugin Creator Robin'
    );
    class NoSinkPlugin extends Gdn_Plugin {
    
        function Setup() {
            $PermissionModel = new PermissionModel();
            $PermissionModel->Undefine('Discussions.Sink');
        }
        function OnDisable() {
            $PermissionModel = new PermissionModel();
            $PermissionModel->Define('Discussions.Sink');
        }
    }
    

    That is just a wild guess. Please don't test it on a live system.

    EDIT: you would have to save that as /plugins/nosink/class.nosink.plugin.php


  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    By the way: users that can change permissions can normally also enable/disable plugins.

    May I ask why you want to do that?


  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Offtopic: my personal opinion is that a plugin like that is rubbish but I love the name and I would love the icon @vrijvlinder would create from such an ambiguity :D


  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Okay...
    1. permission must be 'Vanilla.Discussions.Sink' and
    2. it will not work for admins because a permission check for admins always results in "true" and
    3. do you want to remove a feature because your custom theme broke it?!

    If 3. is true, don't do that. Get your problem solved and don't search for workarounds that may sound promising. They are not. An unsolved error might lead to unforeseen problems at any time.


  • its not working

    peregrine
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @R_J said at 11:07AM:
    2. it will not work for admins

    @deepus said at 12:07PM:
    its not working

    Maybe after all I'm a Crystal Ball candidate...

    Well, is your motivation point 3 of my last posting? If so, I'd say you are looking for the answer to the wrong question.


  • hgtonighthgtonight ∞ · New Moderator

    You would also have to overwrite the sink method to do nothing.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I would simply hide it. Not sure why you want to remove it. When you hide it, make your it is unchecked.

  • peregrineperegrine MVP
    edited May 2014

    its not working

    descriptive??? and the meaning of it is what?

    you could delete the column from your permissions table, and it will disappear from dashboard for all roles. But will reappear on the next /utility/update or /utility/structure

    but as everyone said, really makes no sense, just don't check it. why would you even care if it is in backend?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Maybe because in spanish the locale translations is literal ?

    sink - fregadero which means kitchen sink should be ahogar which means to drown

    peregrineR_Jhgtonight
  • maybe he thinks sink is like kitchen sink (like whole enchilada).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • my final answer to

    How to remove sink option from back end ?

    two pipe wrenches and elbow grease

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    vrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @peregrine said:
    maybe he thinks sink is like kitchen sink (like whole enchilada).

    Yea could be, in WP there is a button for the editor I used called kitchen sink. It basically was a toggle to hide a row of buttons.

  • [email protected]_e‌ said
    maybe he thinks sink is like kitchen sink

    , do you think others are fool like you??

    peregrine
This discussion has been closed.