DI_UserSecurity userSecurity;
SecurityTask tsecurityTask,task;
SecuritySubTask securitySubTask,sub;
SecurityRole tsecurityRole;
SecurityTaskEntryPoint SecurityTaskEntryPoint;
SecurableObject SecurableObject;
SecurityUserRole securityUserRole;
SecurityRole role;
SecurityRoleTaskGrant taskGrant;
SecuritySubTask subTask;
SysUserLog sysUserLog;
UserInfo userinfo;
CreatedDateTime todaydatetime;
int i;
str 50 value;
str 100 dutyName;
int64 myId;
container con;
super();
todaydatetime =DateTimeUtil::newDateTime(today(), 0, DateTimeUtil::getCompanyTimeZone());
delete_from userSecurity;
while select * from sysUserLog group by UserId
join * from userinfo where sysUserLog.UserId == userinfo.id
&& sysUserLog.TerminatedOk == NoYes::Yes
&& sysUserLog.createdDateTime == todaydatetime
//&& sysUserLog.createdDateTime <= ToDate1.dateTimeValue()
// && sysUserLog.createdDateTime >= FromDate1.dateTimeValue()
{
while select * from tsecurityRole join user from securityUserRole where securityUserRole.User == sysUserLog.UserId
&& securityUserRole.SecurityRole == tsecurityRole.RecId
{
select * from SecurityTaskEntryPoint
join RecId from SecurableObject
where SecurableObject.RecId == SecurityTaskEntryPoint.EntryPoint
join SecuritySubTask from subTask
where subTask.SecuritySubTask == SecurityTaskEntryPoint.SecurityTask
join SecurityTask from taskGrant
where taskGrant.SecurityTask == subTask.SecurityTask
join RecId, AotName, name from role
where role.RecId == taskGrant.SecurityRole
&& role.Name like tsecurityRole.Name;
if((tsecurityTask.Type == SecurityTaskType::Duty) || (tsecurityTask.Type == SecurityTaskType::Privilege))
{
select * from tsecurityTask
where tsecurityTask.RecId == taskGrant.SecurityTask
&& SecurityTaskType::Duty == tsecurityTask.Type;
dutyName = tsecurityTask.AotName;
myId = tsecurityTask.RecId;
while select * from tsecurityTask
join securitySubTask where tsecurityTask.RecId == securitySubTask.SecurityTask
&& tsecurityTask.RecId == myId
{
select * from task
join * from sub where task.RecId == sub.SecuritySubTask
&& task.RecId == securitySubTask.SecuritySubTask;
userSecurity.DI_UserId = sysUserLog.UserId;
userSecurity.DI_Role = tsecurityRole.Name;
userSecurity.DI_Duty = dutyName;
userSecurity.DI_Privilege = task.AotName;
userSecurity.insert();
}
}
userSecurity.DI_UserId = sysUserLog.UserId;
userSecurity.DI_Role = tsecurityRole.Name;
userSecurity.DI_Duty = dutyName;
userSecurity.DI_Privilege = task.AotName;
userSecurity.insert();
DI_UserSecurity_ds.research();
}
}
}
SecurityTask tsecurityTask,task;
SecuritySubTask securitySubTask,sub;
SecurityRole tsecurityRole;
SecurityTaskEntryPoint SecurityTaskEntryPoint;
SecurableObject SecurableObject;
SecurityUserRole securityUserRole;
SecurityRole role;
SecurityRoleTaskGrant taskGrant;
SecuritySubTask subTask;
SysUserLog sysUserLog;
UserInfo userinfo;
CreatedDateTime todaydatetime;
int i;
str 50 value;
str 100 dutyName;
int64 myId;
container con;
super();
todaydatetime =DateTimeUtil::newDateTime(today(), 0, DateTimeUtil::getCompanyTimeZone());
delete_from userSecurity;
while select * from sysUserLog group by UserId
join * from userinfo where sysUserLog.UserId == userinfo.id
&& sysUserLog.TerminatedOk == NoYes::Yes
&& sysUserLog.createdDateTime == todaydatetime
//&& sysUserLog.createdDateTime <= ToDate1.dateTimeValue()
// && sysUserLog.createdDateTime >= FromDate1.dateTimeValue()
{
while select * from tsecurityRole join user from securityUserRole where securityUserRole.User == sysUserLog.UserId
&& securityUserRole.SecurityRole == tsecurityRole.RecId
{
select * from SecurityTaskEntryPoint
join RecId from SecurableObject
where SecurableObject.RecId == SecurityTaskEntryPoint.EntryPoint
join SecuritySubTask from subTask
where subTask.SecuritySubTask == SecurityTaskEntryPoint.SecurityTask
join SecurityTask from taskGrant
where taskGrant.SecurityTask == subTask.SecurityTask
join RecId, AotName, name from role
where role.RecId == taskGrant.SecurityRole
&& role.Name like tsecurityRole.Name;
if((tsecurityTask.Type == SecurityTaskType::Duty) || (tsecurityTask.Type == SecurityTaskType::Privilege))
{
select * from tsecurityTask
where tsecurityTask.RecId == taskGrant.SecurityTask
&& SecurityTaskType::Duty == tsecurityTask.Type;
dutyName = tsecurityTask.AotName;
myId = tsecurityTask.RecId;
while select * from tsecurityTask
join securitySubTask where tsecurityTask.RecId == securitySubTask.SecurityTask
&& tsecurityTask.RecId == myId
{
select * from task
join * from sub where task.RecId == sub.SecuritySubTask
&& task.RecId == securitySubTask.SecuritySubTask;
userSecurity.DI_UserId = sysUserLog.UserId;
userSecurity.DI_Role = tsecurityRole.Name;
userSecurity.DI_Duty = dutyName;
userSecurity.DI_Privilege = task.AotName;
userSecurity.insert();
}
}
userSecurity.DI_UserId = sysUserLog.UserId;
userSecurity.DI_Role = tsecurityRole.Name;
userSecurity.DI_Duty = dutyName;
userSecurity.DI_Privilege = task.AotName;
userSecurity.insert();
DI_UserSecurity_ds.research();
}
}
}
No comments:
Post a Comment