<section>
	<div class='form' ng-controller="aclConsolePackageCtrl as formCtrl">
		<form novalidate="" class="css-form ng-pristine" name="">
			<div class="header"><h3 class="">{{translation.modifyACLPackage[LANG]}}: {{currentPackage.code}}</h3></div>
			<div class="body">
				<div ng-if="msg.type">
					<alert type="{{msg.type}}">{{msg.msg}}</alert>
					<br>
				</div>
				<div ng-if="environments_codes.length===0">
					<alert type="warning">No environments found.
						Add your environment before you can edit the ACL.
					</alert>
				</div>
				<div ng-if="oldACL===true">
					<alert type="warning">Your product ACL is still at the package Level and was done with the previous version of SOAJS. The new version of SOAJS allows you to create ACL at the product level and then package it. Either contact Soajs for support or click here to delete the old ACL and create a new one..
					</alert>
				</div>
				<tabset ng-if="oldACL!==true">
					<tab ng-repeat="oneEnv in environments_codes" heading="{{oneEnv.code}}"><br>
						<div id="generate-ApiList-{{oneEnv.code}}" class="entryServiceBoxes">
							<div id="s_{{oneEnv.code}}_{{group._id}}" ng-repeat="group in serviceGroup">
								<fieldset>
									<legend>{{group}}</legend>
									<div ng-repeat="(env, environment) in fixList"  >
										<div  ng-repeat="(g, groups) in environment" ng-if="oneEnv.code.toLowerCase() === env"  >
											<div  ng-repeat="(s, service) in groups" ng-if="g===group" class="clearfix service-container" >
												<div class="clearfix serviceNameHead">
													<div ng-include="'modules/dashboard/productization/directives/service-name-package.tmpl'"></div>
												</div>
												<div ng-include="'modules/dashboard/productization/directives/api-permission-package.tmpl'"></div>
											</div>
										</div>
									</div>
								</fieldset>
							</div>
						</div>
					</tab>
				</tabset>
			</div>
			<div ng-if="oldACL!==true" class="footer" ng-if="environments_codes.length"><br/>
				<input type="submit" class="btn btn-sm btn-primary" ng-click="saveACL()" value="Save ACL"/>
			</div>
			<div ng-if="oldACL===true" class="footer"><br/>
				<input type="submit" class="btn btn-sm btn-danger" ng-click="purgeACL()" value="Purge ACL"/>
			</div>
		</form>
	</div>
</section>