示例#1
0
def delete(dataset):
    if logged_in():
        if tmpl_context.account.admin:
            return True
        elif tmpl_context.account in dataset.managers:
            return True
    return False
示例#2
0
def MainMenu():
    oc = ObjectContainer(no_cache=True)

    logged_in = account.logged_in()
    if not logged_in:
        logged_in = account.authenticate()

    if logged_in:
        is_prime = account.is_prime()

        if is_prime:
            oc.add(DirectoryObject(key=Callback(BrowseMenu, browse_type="movie"), title="Browse Movies"))
            oc.add(DirectoryObject(key=Callback(BrowseMenu, browse_type="tv"), title="Browse TV Shows"))

        oc.add(DirectoryObject(key=Callback(BrowseMenu, is_library=True), title="Your Library"))

        if is_prime:
            oc.add(DirectoryObject(key=Callback(BrowseMenu, is_watchlist=True), title="Your Watchlist"))
            oc.add(SearchDirectoryObject(title="Search", prompt="Search for a Movie or TV Show"))

    oc.add(PrefsObject(title="Preferences"))

    return oc
示例#3
0
def create():
    return logged_in()
示例#4
0
def update(dataset):
    return logged_in() and (tmpl_context.account.admin
                            or tmpl_context.account in dataset.managers)
示例#5
0
def create():
    return logged_in()
示例#6
0
def update(dataset):
    return logged_in() and (tmpl_context.account.admin or
                            tmpl_context.account in dataset.managers)
示例#7
0
def delete(dataset):
    if logged_in() and tmpl_context.account.admin:
        return True
    return False
示例#8
0
def give(badge, dataset):
    """
    Permission to give a badge to a dataset. Currently only administrators
    can reward datasets with badges.
    """
    return logged_in() and tmpl_context.account.admin
示例#9
0
def delete(dataset):
    if logged_in() and tmpl_context.account.admin:
        return True
    return False
示例#10
0
def create(dataset):
    return logged_in() and ds.read(dataset)
示例#11
0
def update(dataset, view):
    if logged_in() and tmpl_context.account == view.account:
        return True
    return ds.edit(dataset)
示例#12
0
def create(dataset):
    return logged_in() and ds.read(dataset)
示例#13
0
def update(dataset, view):
    if logged_in() and tmpl_context.account == view.account:
        return True
    return ds.update(dataset)
示例#14
0
def create():
    """
    Permission to create a new badge. Only administrators can create badges.
    """
    return logged_in() and tmpl_context.account.admin
示例#15
0
def give(badge, dataset):
    """
    Permission to give a badge to a dataset. Currently only administrators
    can reward datasets with badges.
    """
    return logged_in() and tmpl_context.account.admin
示例#16
0
def create():
    return logged_in() and (current_user.admin
                            or current_user in dataset.managers)
示例#17
0
def create():
    return logged_in() and (current_user.admin or current_user in dataset.managers)
示例#18
0
def create():
    """
    Permission to create a new badge. Only administrators can create badges.
    """
    return logged_in() and tmpl_context.account.admin