def delete(dataset): if logged_in(): if tmpl_context.account.admin: return True elif tmpl_context.account in dataset.managers: return True return False
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
def create(): return logged_in()
def update(dataset): return logged_in() and (tmpl_context.account.admin or tmpl_context.account in dataset.managers)
def delete(dataset): if logged_in() and tmpl_context.account.admin: return True return False
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
def create(dataset): return logged_in() and ds.read(dataset)
def update(dataset, view): if logged_in() and tmpl_context.account == view.account: return True return ds.edit(dataset)
def update(dataset, view): if logged_in() and tmpl_context.account == view.account: return True return ds.update(dataset)
def create(): """ Permission to create a new badge. Only administrators can create badges. """ return logged_in() and tmpl_context.account.admin
def create(): return logged_in() and (current_user.admin or current_user in dataset.managers)