Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Correct way of setting security access to editors

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 3521 Views
  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Correct way of setting security access to editors Link to this post

    Is this the same in trunk?

  • AlexBeka
    Avatar
    Community Member
    21 Posts

    Re: Correct way of setting security access to editors Link to this post

    i just checked out http://svn.silverstripe.com/open/phpinstaller/trunk and tried the same testcase as described before, and just inserted the following lines into mysite/_config.php

    Object::add_extension('SiteTree', 'Translatable');
    Translatable::set_default_locale('de_DE');
    Translatable::set_allowed_locales(array('de_DE', 'en_US'));

    i got the same behaviour, it shows "English" in the dropdown-field but showing the german sitetree;

    that´s why i commented out this foreach loop where the locales are removed from $usedLocalesWithTitle;

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Correct way of setting security access to editors Link to this post

    AlexBeka, yes, I have 2.3.3, and I applied the changesets to a Translatable.php as it comes with 2.3.3. (When I used this one Translatable.php?rev=88123 I got the mysql errors as described above about "Locale" / `Locale`)

    What is different is that I gave my content manager the permissions:

    • Access to Site Content (CMSMain)
    • Access to all CMS interfaces
    • Access to Files and Images (AssetAdmin)
    • Translate into all available languages

    Yesterday I had the meeting with the customer and they could edit the content of the German version, no problem, both Languages are shown in the dropdown field.

    Can you try with Translate into all available languages? May be that makes the difference.

    Otherwise, I remember I had a similar issue as you describe when I misspelled the English locale, using "en_UK" instead of "en_GB".

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Correct way of setting security access to editors Link to this post

    I looked at http://svn.silverstripe.com/open/modules/sapphire/trunk/core/model/Translatable.php (I assume that's the one you have, AlexBeka ), but I cannot use that version, it has satements such as

    • Line 356/357:    sprintf( '"%s"."TranslationGroupID" = %d AND "%s"."Locale" != \'%s\'', ....
    • Line 516: $qry = sprintf('"%s"."Locale" = \'%s\'', $baseTable, $locale);
    • Line 995: $filter .= sprintf(' AND "%s"."Locale" = \'%s\'', $baseDataClass, Convert::raw2sql($locale));

    and more like that which seem to result in SQL queries containing WHERE "Whatever"."Locale" = whatever which my MySQL does not like, it would prefer WHERE `Whatever`.`Locale` = whatever.

    My server has the latest released MySQL 4.x version, but not yet 5.x, is that the reason? I really hope not, to upgrade that specific server would be a major issue now.

  • AlexBeka
    Avatar
    Community Member
    21 Posts

    Re: Correct way of setting security access to editors Link to this post

    1.) Kalileo, i have the Translatable.php from 2.3.3 branch not from trunk;
    you have set the permission-code "Translate into all available languages", i know, that this setting would display then all allowed languages in the dropdown;
    but my question was, what happens if you have a translator who should just translate into english and that´s why you give him just the permission to translate into english and not into all languages then this user would see in the dropdown just the english language but he would need also to select the other already existing sitetrees in other languages, like german, to translate these into english;

    2.) i testet yesterday the trunk(http://svn.silverstripe.com/open/phpinstaller/trunk) for a short time (adding, translating pages and so on), and had no problems with sql-queries like you described; i am using mysql 5.1.36;

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Correct way of setting security access to editors Link to this post

    SilverStripe trunk (what will become 2.4) uses "SET sql_mode = 'ANSI'" which makes db abstraction easier, but breaks backwards compatibility with SQL quoting, which now has to be double quotes instead of backticks, hence you can't simply copypaste the whole Translatable.php without modifications to a 2.3.x installation.

    3521 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.