2015-08-01 13:54 GMT+02:00 Ben Cooksley <bcooks...@kde.org>:
> On Sat, Aug 1, 2015 at 11:48 PM, Matthias Klumpp <matth...@tenstral.net> 
> wrote:
>> 2015-07-31 11:41 GMT+02:00 Ben Cooksley <bcooks...@kde.org>:
>>> On Fri, Jul 31, 2015 at 8:42 AM, Kevin Kofler <kevin.kof...@chello.at> 
>>> wrote:
>>>> Luigi Toscano wrote:
>>>>> Feedback on Phabricator gathered outside the BoF from people who could not
>>>>> attend:
>>>>
>>>> Were there no complaints about the fact that you can still not view 
>>>> anything
>>>> at all without logging in?
>>>
>>> This has now been corrected. Unfortunately the old default policy for
>>> issues, etc. was set to "All Users" rather than "Public" so we'll have
>>> to migrate the existing tasks and reviews over to that at some point.
>>> New ones should be properly set to public though
>>
>> You can use the conduit API to automatically set stuff to public, or
>> batch-process the tasks to change their visibility.
>
> Already checked the batch change functionality - it lacks the power to
> change visibility / permissions on tasks (unless I missed something).
> In terms of the Conduit API - I expected that to be the case, just
> don't have a script to hand to do it just yet :)

See the attached script for how to do it ;-) You will need to create a
bot user, generate an API token and install the certificate using
Arcanist before using it.
(and you will also need to adjust it to fit the KDE Phabricator needs,
of course)

>>> unless people
>>> explicitly override (please don't....).
>>
>> You could remove permission to override this setting, or only give it
>> to a specific group of people ;-)
>
> Hmm, where is this permission found? I haven't yet found one that
> allows you to restrict the ability to override default permissions,
> and it's one i'd rather like to find (I know Spaces does have some
> capability in this department though).

Maniphest Settings --> Edit Policies --> Set "Can Edit Task Policies"
to team which should be able to do it, our just to Administrators to
forbid others to change the default.

Hope that helps :-)

Cheers,
    Matthias

-- 
Debian Developer | Freedesktop-Developer
I welcome VSRE emails. See http://vsre.info/
#!/usr/bin/python3

import urllib.request
import json
import os
import sys
import subprocess

PHAB_URL= "http://tracker.tanglu.org";
CONDUIT_TOKEN="api-BLAHBLAH12345678"

def call_conduit(cmd, json_data):
    arcanist_cmd = ["arc", "call-conduit", "--conduit-uri", PHAB_URL, "--conduit-token", CONDUIT_TOKEN, cmd]

    process = subprocess.Popen(arcanist_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
    process.stdin.write(bytes(json_data, 'UTF-8'))
    process.stdin.close()
    process.wait()

    stderr = process.stderr.read()
    stdout = process.stdout.read()

    if stderr:
        print("ERROR:")
        print(stderr)
        sys.exit(2)

    rdata = None
    try:
        rdata = json.loads(stdout.decode('utf-8'))
    except:
        print("ERROR:")
        print(stdout)
        sys.exit(3)

    if rdata['error']:
        if rdata['error'] != "ERR-NO-EFFECT":
            print("ERROR:")
            print(rdata['errorMessage'])
            sys.exit(1)

    return rdata

def main():
    max_tid = 12

    for tid in range(1, max_tid):
        fdata = dict()
        fdata['id'] = tid
        fdata['viewPolicy'] = "public"
        json_data = json.dumps(fdata)
        call_conduit("maniphest.update", json_data)

        print("Processed %i" % (tid))


if __name__ == "__main__":
    main()

Reply via email to