Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bspastoriza19-esi-solutions
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Breixo Senra Pastoriza
bspastoriza19-esi-solutions
Commits
36f83ffd
Commit
36f83ffd
authored
Oct 26, 2025
by
Breixo Senra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quitados los @PermitAll
parent
5734d1ad
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
13 deletions
+18
-13
AdministratorResource.java
...in/java/es/uvigo/esei/xcs/rest/AdministratorResource.java
+1
-1
PetResource.java
rest/src/main/java/es/uvigo/esei/xcs/rest/PetResource.java
+1
-1
AdministratorService.java
.../java/es/uvigo/esei/xcs/service/AdministratorService.java
+3
-2
OwnerService.java
...src/main/java/es/uvigo/esei/xcs/service/OwnerService.java
+1
-2
PetService.java
...e/src/main/java/es/uvigo/esei/xcs/service/PetService.java
+5
-2
VaccinationService.java
...in/java/es/uvigo/esei/xcs/service/VaccinationService.java
+3
-1
VaccineService.java
...c/main/java/es/uvigo/esei/xcs/service/VaccineService.java
+2
-2
VetService.java
...e/src/main/java/es/uvigo/esei/xcs/service/VetService.java
+2
-2
No files found.
rest/src/main/java/es/uvigo/esei/xcs/rest/AdministratorResource.java
View file @
36f83ffd
...
...
@@ -14,7 +14,7 @@ import javax.ws.rs.core.Response;
import
es.uvigo.esei.xcs.service.AdministratorService
;
import
es.uvigo.esei.xcs.service.EmailService
;
@Path
(
"admin
istrator
"
)
@Path
(
"admin"
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
class
AdministratorResource
{
...
...
rest/src/main/java/es/uvigo/esei/xcs/rest/PetResource.java
View file @
36f83ffd
...
...
@@ -29,7 +29,7 @@ import es.uvigo.esei.xcs.service.PetService;
*
* @author Miguel Reboiro Jato
*/
@Path
(
"pet
tt
"
)
@Path
(
"pet"
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
class
PetResource
{
...
...
service/src/main/java/es/uvigo/esei/xcs/service/AdministratorService.java
View file @
36f83ffd
...
...
@@ -10,6 +10,7 @@ import javax.persistence.EntityManager;
import
javax.persistence.PersistenceContext
;
import
es.uvigo.esei.xcs.domain.entities.Administrator
;
import
es.uvigo.esei.xcs.domain.entities.User
;
@Stateless
@RolesAllowed
(
"ADMIN"
)
...
...
@@ -23,14 +24,14 @@ public class AdministratorService {
}
public
List
<
Administrato
r
>
list
(
int
page
,
int
pageSize
){
public
List
<
Use
r
>
list
(
int
page
,
int
pageSize
){
if
(
page
<
0
)
{
throw
new
IllegalArgumentException
(
"The page can't be negative"
);
}
if
(
pageSize
<=
0
)
{
throw
new
IllegalArgumentException
(
"The page size can't be negative or zero"
);
}
return
em
.
createQuery
(
"SELECT DISTINCT
a FROM Administrator a"
,
Administrato
r
.
class
)
return
em
.
createQuery
(
"SELECT DISTINCT
u FROM User u"
,
Use
r
.
class
)
.
setFirstResult
((
page
-
1
)
*
pageSize
)
.
setMaxResults
(
pageSize
)
.
getResultList
();
...
...
service/src/main/java/es/uvigo/esei/xcs/service/OwnerService.java
View file @
36f83ffd
...
...
@@ -25,8 +25,7 @@ import es.uvigo.esei.xcs.domain.entities.Vaccination;
* @author Miguel Reboiro Jato
*/
@Stateless
//@RolesAllowed("ADMIN")
@PermitAll
@RolesAllowed
(
"ADMIN"
)
public
class
OwnerService
{
@PersistenceContext
private
EntityManager
em
;
...
...
service/src/main/java/es/uvigo/esei/xcs/service/PetService.java
View file @
36f83ffd
...
...
@@ -30,8 +30,8 @@ import es.uvigo.esei.xcs.domain.entities.Vet;
* @author Miguel Reboiro Jato
*/
@Stateless
//@RolesAllowed("VET"
)
@PermitAll
@RolesAllowed
({
"VET"
,
"OWNER"
}
)
//
@PermitAll
public
class
PetService
{
@Inject
private
Principal
currentUser
;
...
...
@@ -201,6 +201,7 @@ public class PetService {
}
@RolesAllowed
(
"VET"
)
public
void
assignVetToPet
(
Long
petId
)
{
requireNonNull
(
petId
,
"Pet ID can't be null"
);
//requireNonNull(vetLogin, "Vet login can't be null");
...
...
@@ -219,6 +220,7 @@ public class PetService {
}
@RolesAllowed
(
"VET"
)
public
void
unassignVetFromPet
(
Long
petId
)
{
requireNonNull
(
petId
,
"Pet ID can't be null"
);
//requireNonNull(vetLogin, "Vet login can't be null");
...
...
@@ -240,6 +242,7 @@ public class PetService {
return
this
.
currentUser
;
}
@RolesAllowed
(
"VET"
)
public
boolean
isAssignedToCurrentVet
(
Long
petId
)
{
requireNonNull
(
petId
,
"Pet ID can't be null"
);
...
...
service/src/main/java/es/uvigo/esei/xcs/service/VaccinationService.java
View file @
36f83ffd
...
...
@@ -9,6 +9,7 @@ import java.text.SimpleDateFormat;
import
java.util.List
;
import
javax.annotation.security.PermitAll
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
javax.inject.Inject
;
...
...
@@ -22,7 +23,8 @@ import es.uvigo.esei.xcs.domain.entities.Vaccination;
import
es.uvigo.esei.xcs.domain.entities.Vaccine
;
@Stateless
@PermitAll
@RolesAllowed
(
"VET"
)
//@PermitAll
public
class
VaccinationService
{
@Inject
private
Principal
currentUser
;
...
...
service/src/main/java/es/uvigo/esei/xcs/service/VaccineService.java
View file @
36f83ffd
...
...
@@ -18,8 +18,8 @@ import es.uvigo.esei.xcs.domain.entities.Pet;
import
es.uvigo.esei.xcs.domain.entities.Vaccine
;
@Stateless
@PermitAll
//
@RolesAllowed("VET")
//
@PermitAll
@RolesAllowed
(
"VET"
)
public
class
VaccineService
{
@PersistenceContext
private
EntityManager
em
;
...
...
service/src/main/java/es/uvigo/esei/xcs/service/VetService.java
View file @
36f83ffd
...
...
@@ -18,8 +18,8 @@ import es.uvigo.esei.xcs.domain.entities.Vaccination;
import
es.uvigo.esei.xcs.domain.entities.Vet
;
@Stateless
//
@RolesAllowed("VET")
@PermitAll
@RolesAllowed
(
"VET"
)
//
@PermitAll
public
class
VetService
{
@Inject
private
Principal
currentUser
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment