Exemplo n.º 1
0
        public ActionResult Groups(int id)
        {
            var version = Entities().VariantVersions.Find(id);

            if (version == null)
            {
                return(HttpNotFound());
            }

            UserService users = GetService <UserService>();

            if (!users.IsAllowedToEdit(version.Variant, User.Identity.Name))
            {
                return(new HttpUnauthorizedResult());
            }

            DefinitionService definitions = GetService <DefinitionService>();
            var global   = definitions.ListGlobalDirections(version);
            var relative = definitions.ListRelativeDirections(version);
            var model    = new DirectionGroupsModel(version, string.Join(";", global.Concat(relative)), definitions.GetDirectionGroups(version));

            return(View(model));
        }