Ran into an issue, where I was trying to modify permissions on a user, and it 
changed root.
Now my root is not a super user.
I ran this command: perl -I /opt/rt4/lib -MRT -e' RT::LoadConfig(); RT::Init(); 
my $u = RT::User->new($RT::Systemuser); $u->Load("root"); print 
$u->PrincipalObj->GrantRight(Object => $RT::System, Right => "SuperUser");'
And I got this response:
[3228] [Mon Oct 10 17:16:18 2016] [debug]: Using internal Perl HTML -> text 
conversion (/opt/rt4/lib/RT/Interface/Email.pm:1454)
[3228] [Mon Oct 10 17:16:18 2016] [debug]: The RTAddressRegexp option is not 
set in the config. Not setting this option results in additional SQL queries to 
check whether each address belongs to RT or not. It is especially important to 
set this option if RT receives emails on addresses that are not in the database 
or config. (/opt/rt4/lib/RT/Config.pm:531)
[3228] [Mon Oct 10 17:16:18 2016] [critical]: Can't call method "HasRight" on 
an undefined value at /opt/rt4/lib/RT/ACE.pm line 237, <DATA> line 747. 
(/opt/rt4/lib/RT.pm:390)
Can't call method "HasRight" on an undefined value at /opt/rt4/lib/RT/ACE.pm 
line 237, <DATA> line 747.

Root still does not have super user rights.

I tried to change a user that does not have super user rights and never has and 
I got this response instead:

perl -I /opt/rt4/lib -MRT -e' RT::LoadConfig(); RT::Init(); my $u = 
RT::User->new($RT::Systemuser); $u->Load("u...@domain.com"); print 
$u->PrincipalObj->GrantRight(Object => $RT::System, Right => "SuperUser");'
[3231] [Mon Oct 10 17:17:01 2016] [debug]: Using internal Perl HTML -> text 
conversion (/opt/rt4/lib/RT/Interface/Email.pm:1454)
[3231] [Mon Oct 10 17:17:01 2016] [debug]: The RTAddressRegexp option is not 
set in the config. Not setting this option results in additional SQL queries to 
check whether each address belongs to RT or not. It is especially important to 
set this option if RT receives emails on addresses that are not in the database 
or config. (/opt/rt4/lib/RT/Config.pm:531)
[3231] [Mon Oct 10 17:17:01 2016] [error]: Couldn't get principal for an empty 
user (/opt/rt4/lib/RT/User.pm:1282)
[3231] [Mon Oct 10 17:17:01 2016] [critical]: Can't call method "GrantRight" on 
an undefined value at -e line 1, <DATA> line 747. (/opt/rt4/lib/RT.pm:390)
Can't call method "GrantRight" on an undefined value at -e line 1, <DATA> line 
747.

I got this script from RT Esentials, which was written for RT3, any chance 
someone can help me with an RT4 version?

Thanks

Lori
---------
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Reply via email to