Enabling an acces to the new UCP module tab for specified users only

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
Vogelek23
Registered User
Posts: 57
Joined: Tue Aug 17, 2010 7:30 pm
Location: Poland
Name: Łukasz
Contact:

Enabling an acces to the new UCP module tab for specified users only

Post by Vogelek23 » Sun Nov 23, 2014 4:51 am

Hello, friends.

I have a small problem and i need your help.

Few days ago i wrote some simple MOD to managing the advertisements on my forum.
This MOD relies on UCP module. I have added necessary files into the proper locations, and then created a new module under ACP -> System -> Modules Management -> UCP.

My new module works great except for one small thing - it's available as a tab for all users by UCP menu.
I want to disable this tab from access to ALL users, except for those, which are an advertisers.
Advertisers are marked in the database - in the USERS table I created a new column named "advertiser" with default value set to 0. If I will mark some user as advertiser, this value is changed to 1.

Is there any method to disable UCP tab from access or enable it only for specified users, basing on the database column value?
I would appreciate your help.
Last edited by Oyabun1 on Thu Nov 27, 2014 8:56 am, edited 1 time in total.
Reason: Moved from 3.0.x MOD Requests
Professional computer repair forum.
The largest documentation database in Europe.
FREE and professional advice from over 30.000 users.
Earn money for activity!
https://www.elvikom.pl

User avatar
RaythXC
Registered User
Posts: 150
Joined: Wed Jun 13, 2012 1:23 pm

Re: Enabling an acces to the new UCP module tab for specified users only

Post by RaythXC » Sun Nov 23, 2014 3:14 pm

You'll need to assign permissions for the MOD:
[wiki] This Page is the guide for creating modules, which shows where to put permission stuff,

and

[wiki] This page shows how to add permissions.

[wiki] This page might also help. It relates to the MCP but the concept is the same for UCP

Locked

Return to “[3.0.x] MOD Writers Discussion”