var angular = require('cla_angular');

/**
 * The controller that handles the roles list
 *
 *
 */
(function () {
	'use strict';

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

	module.controller('RolesController', RolesController);

	/**
	 * @constructor
	 */
	function RolesController() {
		var ctrl = this;

		ctrl.roles = [];
		ctrl.options = {
			can_add_role: false,
			can_delete_role: false,
			can_edit_role_name: false,
			can_edit_role_sugre: false
		};

		ctrl.init = init;

		function init(data) {
			ctrl.roles = data.roles;
			ctrl.options = data.options;
		}
	}
}());