-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
179 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../main/java/org/bonitasoft/console/common/server/page/ApplicationAuthorizationsHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright (C) 2022 Bonitasoft S.A. | ||
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble | ||
* This library is free software; you can redistribute it and/or modify it under the terms | ||
* of the GNU Lesser General Public License as published by the Free Software Foundation | ||
* version 2.1 of the License. | ||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Lesser General Public License for more details. | ||
* You should have received a copy of the GNU Lesser General Public License along with this | ||
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth | ||
* Floor, Boston, MA 02110-1301, USA. | ||
**/ | ||
package org.bonitasoft.console.common.server.page; | ||
|
||
import org.bonitasoft.engine.session.APISession; | ||
import org.bonitasoft.livingapps.ApplicationModel; | ||
import org.bonitasoft.livingapps.ApplicationModelFactory; | ||
|
||
public class ApplicationAuthorizationsHelper { | ||
|
||
private final APISession apiSession; | ||
private final ApplicationModelFactory applicationFactory; | ||
|
||
public ApplicationAuthorizationsHelper(final APISession apiSession, | ||
final ApplicationModelFactory applicationModelFactory) { | ||
this.apiSession = apiSession; | ||
this.applicationFactory = applicationModelFactory; | ||
} | ||
|
||
public boolean isAuthorized(final String applicationToken) { | ||
try { | ||
final ApplicationModel application = applicationFactory.createApplicationModel(applicationToken); | ||
return application.authorize(apiSession); | ||
} catch (final Exception e) { | ||
return false; | ||
} | ||
} | ||
|
||
} |
76 changes: 0 additions & 76 deletions
76
...c/main/java/org/bonitasoft/console/common/server/page/CustomPageAuthorizationsHelper.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.