Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

Source modification set in the modification log but not in the metadata/display [Solved]

edited February 14 in Troubleshooting
Hello everyone !

I'm having an issue with the source definition for some user access. Let me explain. I'm using the source access checking to limit access for some user.
For instance user A is an administrator and have access to everything. User B is a end user and have access to everything (except settings). User C have access only when the source is set to is department.

The access limitation for users works fine. User C only have access when the source is correctly set.
The source value set in the log is the correct one. However the list metadata for source and the value in the display is displaying an other value (the default one if set or the first on alphabetical order if none is set on default) for the user A and B.

If i set the perform access checking to 0, the displayed values are set correctly again for all users but we really need to use it...
I also tried when using the default profile and the problem isn't happening. So i guess it's relevant to my config/settings...but i'm not sure where...

Any hint to solve this ?
Thanks a lot !!

John

Comments

  • Ok... I restored the database from a back-up from last month and it's working again... I'll keep that in mind when recreating the configs and try to identify what i did wrong...
  • edited February 7
    I narrowed it down a bit... It's happening when setting a role (Role A or B in my previous example) to the user accounts.
    However using the main administrator account (without setting it to the admin group) works fine.
    The only difference i can spot between the account A/B and C is that C is limited to one specific source, while A/B have access to all sources.
    User C also can't modify the source, which is possible for users A/B.
  • edited February 10
    And it's not limited to my schema. I tried again the default xml and set the administrator to the admin group and it always give the source "External Collection", even when set to "Permanent Collection".

    It's happening on v1.6.2, 1.6.3 and 1.7. I don't remember it was happening on v1.6 or v1.6.1 but i'll try to be sure.
  • Source-level access control was added at the request of a user who then ignored it. It is rarely used, if ever, and it wouldn't surprise me if there are issues. We'll try to take a look when time allows.


    seth
  • edited February 9
    Thanks ! It's a really important feature for us...

    Please let me know how i can help with that !

    I'll check with v1.6 and 1.6.1 to see if it was working.

    As workaround, i'll create an other metadata based on the source list and (try to) make a plugin that set the source accordingly.
    The expected result is that the users will have the correct value display and the source will be set and select the access level as well.

    I'll let you know if it works ;-)

    John
  • edited February 10
    I tried with providence v1.6.1 and it's displaying the correct value.
    I'll try to narrow down what changed and could be causing this.

    John
  • Hello !
    I'm trying to build a plugin to set a metadata (source_id) according to another metadata (MTD_RIR_Assign) to bypass the source display issue from perform_source_cheking (see http://collectiveaccess.org/support/forum/index.php?p=/discussion/298213/source-modification-set-in-the-modification-log-but-not-in-the-metadata-display#latest for the details). I can get the MTD_RIR_Assign value but i can't set it to the source_id with the plugin. I'm a real newbie in PHP so if someone could help me with this it would be great !
    Here is the code :

    public function hookSaveItem(&$args) {
        $item = $args["instance"];
        $type = $va_type_list[$vn_type_id];

        $OrigSource = $item->get("source_id");
        $Attribution = $item->get("ca_objects.MTD_RIR_Assign");
        $item -> set("source_id", $Attribution);
    }

    I used the hookSaveitem to get the saved value and not the one before modification (which i get when using the hookBeforeSaveItem). The two metadata are using the same list (object_source) so the values are the same so I don't need any condition to adjust them.
    I came up with this from https://gist.github.com/anonymous/2e591db30700f2d235a9
  • Hello again !

    I narrowed the problem to the line this line :
    ($pt_subject->get('source_id') && in_array($pt_subject->get('source_id'), $va_restrict_to_sources))
    in the BaseEditorController.php in app/lib/ca/

    On v1.6.1 it was set to :
    ($pt_subject->get('source_id') && !in_array($pt_subject->get('source_id'), $va_restrict_to_sources))

    I'm not sure what are the implications of this modification but it triggers the wrong valu on the summary and the metadata bundle.

    John


  • Thanks for the commit that solves it !!

    John
Sign In or Register to comment.