Jump to content

[HELP] Admin GUI elements enabling/disabling


MIKI785

Recommended Posts

Hello,

I'm little bit editing the 'admin' resource and I can't find where all the enabling and disabling is. I mean, it checks if you have permission to have some GUI element enabled, like tab 'Server'.

In ACL you have so Tab 'Server' will be disabled. Where is the script that disables it?

I want to make some new permissions and I need to see how it works.

Link to comment

The rights are being checked client side inside of the "/admin/client/admin_gui.lua" file.

_guiCreateTab = guiCreateTab 
function guiCreateTab ( name, parent, right ) 
    local tab = _guiCreateTab ( name, parent ) 
    if ( tab ) then 
        if ( right ) then 
            right = "general.tab_"..right 
            if ( not hasPermissionTo ( right ) ) then 
                guiSetEnabled ( tab, false ) 
                _guiprotected[right] = tab 
            end 
        end 
        return tab 
    end 
    return false 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...