Skip to content

Commit

Permalink
refactor: remove spring security
Browse files Browse the repository at this point in the history
Remove `<sec>` from JSPs.

#1961
  • Loading branch information
jo-elimu committed Jan 15, 2025
1 parent 00f4683 commit 89bc0a1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/admin/layout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@
<li><a href="<spring:url value='/contributor/edit-name' />"><i class="material-icons left">mode_edit</i><fmt:message key="edit.name" /></a></li>
<%--<li class="divider"></li>
<li><a href="<spring:url value='/content/contributor/edit-email' />"><i class="material-icons left">mail</i><fmt:message key="edit.email" /></a></li>--%>
<sec:authorize access="hasRole('ROLE_ADMIN')">
<c:if test="${fn:contains(contributor.roles, 'ADMIN')}">
<li class="divider"></li>
<li><a href="<spring:url value='/admin' />"><i class="material-icons left">build</i><fmt:message key="administration" /></a></li>
</sec:authorize>
<sec:authorize access="hasRole('ROLE_ANALYST')">
</c:if>
<c:if test="${fn:contains(contributor.roles, 'ANALYST')}">
<li class="divider"></li>
<li><a href="<spring:url value='/analytics' />"><i class="material-icons left">timeline</i><fmt:message key="analytics" /></a></li>
</sec:authorize>
</c:if>
<li class="divider"></li>
<li><a id="logout" href="<spring:url value='/logout' />"><i class="material-icons left">power_settings_new</i><fmt:message key="sign.out" /></a></li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/content/layout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@
<li><a href="<spring:url value='/content/contributor/edit-name' />"><i class="material-icons left">mode_edit</i><fmt:message key="edit.name" /></a></li>
<%--<li class="divider"></li>
<li><a href="<spring:url value='/content/contributor/edit-email' />"><i class="material-icons left">mail</i><fmt:message key="edit.email" /></a></li>--%>
<sec:authorize access="hasRole('ROLE_ADMIN')">
<c:if test="${fn:contains(contributor.roles, 'ADMIN')}">
<li class="divider"></li>
<li><a href="<spring:url value='/admin' />"><i class="material-icons left">build</i><fmt:message key="administration" /></a></li>
</sec:authorize>
<sec:authorize access="hasRole('ROLE_ANALYST')">
</c:if>
<c:if test="${fn:contains(contributor.roles, 'ANALYST')}">
<li class="divider"></li>
<li><a href="<spring:url value='/analytics' />"><i class="material-icons left">timeline</i><fmt:message key="analytics" /></a></li>
</sec:authorize>
</c:if>
<li class="divider"></li>
<li><a id="logout" href="<spring:url value='/logout' />"><i class="material-icons left">power_settings_new</i><fmt:message key="sign.out" /></a></li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/multimedia/image/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
<button id="submitButton" class="btn-large waves-effect waves-light" type="submit">
<fmt:message key="edit" /> <i class="material-icons right">send</i>
</button>
<sec:authorize access="hasRole('ROLE_EDITOR')">
<c:if test="${fn:contains(contributor.roles, 'EDITOR')}">
<a href="<spring:url value='/content/multimedia/image/delete/${image.id}' />" class="waves-effect waves-red red-text btn-flat right"><fmt:message key="delete" /></a>
</sec:authorize>
</c:if>
</form:form>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/storybook/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@

<c:forEach var="storyBookChapter" items="${storyBookChapters}" varStatus="status">
<a name="ch-id-${storyBookChapter.id}"></a>
<sec:authorize access="hasRole('ROLE_EDITOR')">
<c:if test="${fn:contains(contributor.roles, 'EDITOR')}">
<a class="storyBookChapterDeleteLink right red-text" style="margin-top: 1em;" href="<spring:url value='/content/storybook/edit/${storyBook.id}/chapter/delete/${storyBookChapter.id}' />"><i class="material-icons" title="<fmt:message key='delete' />">delete</i></a>
</sec:authorize>
</c:if>
<h5 style="margin-top: 1em;" class="grey-text"><fmt:message key="chapter" />&nbsp;${storyBookChapter.sortOrder + 1}/${fn:length(storyBookChapters)}</h5>
<div class="card-panel storyBookChapter">
<c:if test="${not empty storyBookChapter.image}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<button id="submitButton" class="btn-large waves-effect waves-light" type="submit">
<fmt:message key="edit" /> <i class="material-icons right">send</i>
</button>
<sec:authorize access="hasRole('ROLE_EDITOR')">
<c:if test="${fn:contains(contributor.roles, 'EDITOR')}">
<a href="<spring:url value='/content/storybook/paragraph/delete/${storyBookParagraph.id}' />" class="waves-effect waves-red red-text btn-flat right"><fmt:message key="delete" /></a>
</sec:authorize>
</c:if>
</form:form>
</div>
</content:section>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/content/word/edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@
<button id="submitButton" class="btn-large waves-effect waves-light" type="submit">
<fmt:message key="edit" /> <i class="material-icons right">send</i>
</button>
<sec:authorize access="hasRole('ROLE_EDITOR')">
<c:if test="${fn:contains(contributor.roles, 'EDITOR')}">
<a href="<spring:url value='/content/word/delete/${word.id}' />" class="waves-effect waves-red red-text btn-flat right"><fmt:message key="delete" /></a>
</sec:authorize>
</c:if>
</form:form>
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/layout.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<a id="logo-container" href="<spring:url value='/' />" class="brand-logo">
<img src="<spring:url value='/static/img/logo-text-256x77.png' />" alt="elimu.ai" />
</a>
<sec:authorize access="!hasAnyRole('ROLE_ADMIN','ROLE_CONTRIBUTOR')">
<c:if test="${empty contributor}">
<ul class="right hide-on-med-and-down">
<li><a href="<spring:url value='/sign-on' />"><fmt:message key="sign.on" /></a></li>
</ul>
Expand Down Expand Up @@ -111,8 +111,8 @@
</c:choose>
<li><a class="btn signOnBtn" href="<spring:url value='/sign-on' />"><fmt:message key="sign.on" /></a></li>
</ul>
</sec:authorize>
<sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_CONTRIBUTOR')">
</c:if>
<c:if test="${not empty contributor}">
<ul id="nav-mobile" class="side-nav">
<li>
<a class="btn tokenButtonSideNav" href="<spring:url value='/sign-on/web3' />">
Expand Down Expand Up @@ -157,7 +157,7 @@
</div>
</a>
</ul>
</sec:authorize>
</c:if>

<ul class="right">
<script>
Expand Down

0 comments on commit 89bc0a1

Please sign in to comment.