bucket = Buckets.at(Bucket::MANIFESTS_LOCAL);
// when app is installed locally add/remove redirection from MANIFESTS_GLOBAL to MANIFESTS_LOCAL
- if (policyRemove) {
+ if (policyRemove || oldLabel != newLabel) {
newPolicies.push_back(CynaraAdminPolicy(
oldLabel,
cynaraUser,
"*",
static_cast<int>(CynaraAdminPolicy::Operation::Delete),
Buckets.at(Bucket::MANIFESTS_GLOBAL)));
- } else {
- if (oldLabel != newLabel) {
- newPolicies.push_back(CynaraAdminPolicy(
- oldLabel,
- cynaraUser,
- "*",
- static_cast<int>(CynaraAdminPolicy::Operation::Delete),
- Buckets.at(Bucket::MANIFESTS_GLOBAL)));
- }
+ }
+ if (!policyRemove) {
newPolicies.push_back(CynaraAdminPolicy(
newLabel,
cynaraUser,
InstallHelper ih;
ih.isUserPkgInstalled = m_privilegeDb.IsUserPkgInstalled(req.pkgName, req.uid);
- ih.isOldPkgHybrid = m_privilegeDb.IsPackageHybrid(req.pkgName);
+ ih.isOldPkgHybrid = ih.isUserPkgInstalled ? m_privilegeDb.IsPackageHybrid(req.pkgName) : req.isHybrid;
if (ih.isUserPkgInstalled && ih.isOldPkgHybrid != req.isHybrid) {
LogError("Application conflicts with existing one. " <<
InstallHelper ih;
ih.isUserPkgInstalled = m_privilegeDb.IsUserPkgInstalled(req.pkgName, req.uid);
- ih.isOldPkgHybrid = m_privilegeDb.IsPackageHybrid(req.pkgName);
+ ih.isOldPkgHybrid = ih.isUserPkgInstalled ? m_privilegeDb.IsPackageHybrid(req.pkgName) : req.isHybrid;
if (ih.isUserPkgInstalled and ih.isOldPkgHybrid != req.isHybrid) {
// search for installed apps in the request