Examples of canViewContest()


Examples of cn.edu.zju.acm.onlinejudge.security.UserSecurity.canViewContest()

        if (level == PermissionLevel.ADMIN) {
            hasPermisstion = userSecurity.canAdminContest(contest.getId());
        } else if (level == PermissionLevel.PARTICIPATE) {
            hasPermisstion = userSecurity.canParticipateContest(contest.getId());
        } else if (level == PermissionLevel.VIEW) {
            hasPermisstion = userSecurity.canViewContest(contest.getId());
        } else if (level == PermissionLevel.PARTICIPATECANVIEWSOURCE) {
            hasPermisstion = userSecurity.canViewSource(contest.getId());
        }
        if (!hasPermisstion) {
            ActionMessages messages = new ActionMessages();
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.security.UserSecurity.canViewContest()

        } else if (level == PermissionLevel.PARTICIPATE) {
            hasPermisstion = userSecurity.canParticipateContest(contest.getId());
        } else if (level == PermissionLevel.PARTICIPATECANVIEWSOURCE) {
            hasPermisstion = userSecurity.canViewSource(contest.getId());
        } else if (level == PermissionLevel.VIEW) {
            hasPermisstion = userSecurity.canViewContest(contest.getId());
        }
        if (!hasPermisstion) {
            ActionMessages messages = new ActionMessages();
            messages.add("message", new ActionMessage("onlinejudge.showcontest.nopermission"));
            this.saveErrors(context.getRequest(), messages);
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.security.UserSecurity.canViewContest()

    protected List<AbstractContest> getCheckedContests(List<AbstractContest> contests) throws PersistenceException {
        UserSecurity userSecurity = this.getUserSecurity();

        List<AbstractContest> ret = new ArrayList<AbstractContest>();
        for (AbstractContest contest : contests) {
            if (userSecurity.canViewContest(contest.getId())) {
                ret.add(contest);
            }
        }
        return ret;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.