Cpanel plugin visible only to some users depend of ownership.

gemby

Well-Known Member
PartnerNOC
Feb 16, 2002
182
0
316
Pula, Croatia
cPanel Access Level
DataCenter Provider
I am trying to make some cpanel plugin, that must be visbile to users regarding of ownership. Meaning, i would like to plugin to bi visible to users whom is root owner, but not visible to users whom is reseller owner. When i look in auto generated yaml file of newly created plugin, there if statment IF: empty one, but could not figure out how to use it.

Plugin is ready, but i is visible to all users.

Yes, i know that feature list is maybe good way to go, but not as automatic as i would like to.

Any ideas?
 
Last edited:

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
I am trying to make some cpanel plugin, that must be visbile to users regarding of ownership. Meaning, i would like to plugin to bi visible to users whom is root owner, but not visible to users whom is reseller owner. When i look in auto generated yaml file of newly created plugin, there if statment IF: empty one, but could not figure out how to use it.

Plugin is ready, but i is visible to all users.

Yes, i know that feature list is maybe good way to go, but not as automatic as i would like to.

Any ideas?
Let me see if I understand what you are looking for.

You want your plugin to be visible if the person has root-level access to WHM, but invisible to everyone else?

If that is the case, here is a useful article that will show you the basics on how to do this:

WHM Plugins - cPanel Integration

The ACL you would check for to detect if they have root-level access is the ACL called 'all'
 

gemby

Well-Known Member
PartnerNOC
Feb 16, 2002
182
0
316
Pula, Croatia
cPanel Access Level
DataCenter Provider
Let me see if I understand what you are looking for.

You want your plugin to be visible if the person has root-level access to WHM, but invisible to everyone else?

If that is the case, here is a useful article that will show you the basics on how to do this:

WHM Plugins - cPanel Integration

The ACL you would check for to detect if they have root-level access is the ACL called 'all'
Tnx David, but not not quite like that. This is whm related, but i would like to show, or not show cpanel icon, and plugin behind it, regarding to whom this cpanel account belongs. Eg, that accounts under ownership of one reseller sees plugin, but other do not. In users cpanel, not in whm.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
If you make your cPanel plugin visible in the feature list, it can be toggled on a per-package basis. If you limit reseller accounts to specific packages, and those packages have a feature list that does not contain that feature (or does contain that feature) you can effectively limit the feature to just cPanel accounts owned by specific resellers.
 

gemby

Well-Known Member
PartnerNOC
Feb 16, 2002
182
0
316
Pula, Croatia
cPanel Access Level
DataCenter Provider
If you make your cPanel plugin visible in the feature list, it can be toggled on a per-package basis. If you limit reseller accounts to specific packages, and those packages have a feature list that does not contain that feature (or does contain that feature) you can effectively limit the feature to just cPanel accounts owned by specific resellers.
Yes, this will probably solve it, but problem is that we allowed resellers to use our packages too, and this "owner" thing is also usable for other things, reporting some things to our users, resellers, but not to their clients, depending who owns package? So, is it possible to extract owner of package?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Yes, this will probably solve it, but problem is that we allowed resellers to use our packages too, and this "owner" thing is also usable for other things, reporting some things to our users, resellers, but not to their clients, depending who owns package? So, is it possible to extract owner of package?
The owner of the package is not necessarily the owner of the account. For example, if Reseller1 owns User1, but the package rootPkg was created by root and delegated to Reseller1, then even if this package is assigned to User1, the package being used by User1 would be owned by root, not Reseller1.

I believe it would be better (by means of being far less troublesome) to work on the basis of who owns which accounts when it comes to data reporting. The ownership of an account can be determined via the XML API in a few ways, but using the account summary functionality seems to be the best fit: ShowAccountInformation < SoftwareDevelopmentKit < TWiki
 

gemby

Well-Known Member
PartnerNOC
Feb 16, 2002
182
0
316
Pula, Croatia
cPanel Access Level
DataCenter Provider
The owner of the package is not necessarily the owner of the account. For example, if Reseller1 owns User1, but the package rootPkg was created by root and delegated to Reseller1, then even if this package is assigned to User1, the package being used by User1 would be owned by root, not Reseller1.

I believe it would be better (by means of being far less troublesome) to work on the basis of who owns which accounts when it comes to data reporting. The ownership of an account can be determined via the XML API in a few ways, but using the account summary functionality seems to be the best fit: ShowAccountInformation < SoftwareDevelopmentKit < TWiki
Yes, that's what i am looking for, tnx m8 ;-)