var angular = require('cla_angular');

/**
 * The controller that handles the rights matrix
 *
 *
 */
(function () {
	'use strict';

	var moduleName = 'cla.core.acl.rolebased'; var module;
	try { module = angular.module(moduleName); }
	catch(err) { module = angular.module(moduleName, []); }

	module.controller('RightsController', RightsController);

	/**
	 * @constructor
	 */
	RightsController.$inject = ['claRoleService'];
	function RightsController(roleService) {
		var ctrl = this;

		ctrl.rights = [];
		ctrl.right_groups = [];

		ctrl.init = init;

		function init(data) {
			ctrl.rights = data.rights;
			ctrl.rightGroups = data.right_groups;
		}
	}
}());