Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
import com.cloud.user.AccountService;
import com.cloud.user.AccountVO;
import com.cloud.user.ResourceLimitService;
import com.cloud.user.User;
import com.cloud.user.UserData;
import com.cloud.user.dao.AccountDao;
import com.cloud.uservm.UserVm;
Expand Down Expand Up @@ -1448,6 +1449,7 @@ public boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissions
// Input validation
final Long id = cmd.getId();
final Account caller = CallContext.current().getCallingAccount();
final User user = CallContext.current().getCallingUser();
List<String> accountNames = cmd.getAccountNames();
List<Long> projectIds = cmd.getProjectIds();
Boolean isFeatured = cmd.isFeatured();
Expand Down Expand Up @@ -1517,9 +1519,8 @@ public boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissions
}

if (owner.getType() == Account.Type.PROJECT) {
// Currently project owned templates cannot be shared outside project but is available to all users within project by default.
throw new InvalidParameterValueException("Update template permissions is an invalid operation on template " + template.getName() +
". Project owned templates cannot be shared outside template.");
// if it is a project owned template/iso, the user must at least have access to be allowed to share it.
_accountMgr.checkAccess(user, template);
}

// check configuration parameter(allow.public.user.templates) value for
Expand Down
2 changes: 2 additions & 0 deletions ui/src/views/compute/DeployVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,7 @@ export default {
}
args.zoneid = _.get(this.zone, 'id')
args.templatefilter = templateFilter
args.projectid = -1
args.details = 'all'
args.showicon = 'true'
args.id = this.templateId
Expand All @@ -2298,6 +2299,7 @@ export default {
}
args.zoneid = _.get(this.zone, 'id')
args.isoFilter = isoFilter
args.projectid = -1
args.bootable = true
args.showicon = 'true'
args.id = this.isoId
Expand Down