HelloZeroNet / HelloZeroNet/ZeroNet
MergerSite - Zite retains old merger_type permission after modifying wrapperPermissionAdd.
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.8k
- Forks
- 2.3k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Step 1: Please describe your environment
* ZeroNet version: 0.7.2
* Operating system: Manjaro
* Web browser: Firefox
* Tor status: disabled
* Opened port: yes
* Special configuration: no
### Step 2: Describe the problem:
I cloned GitCenter.
I downloaded GitCenter and then rewrote it to my liking in order to start my own GitCenter, called ZeroSafe.
My site however is still looking for GitCenter sites.
I've noticed that this is due to this function:
```
zeroPage.cmd("wrapperPermissionAdd", ["Merger:ZeroSafe"])
```
This adds a permission, but does not set it.
So whenever I change it, it adds another permission
and when I went a little digging I could not find any command that removes or empties the permissions.
I can't manually remove the in sites.json either and I have no idea where these permissions are stored.
#### Steps to reproduce:
1. Open a couple of Gitcenter projects.
2. Recreate Gitcenter, name it Newcenter.
3. Edit the following in your Newcenter site:
```diff
-- zeroPage.cmd("wrapperPermissionAdd", ["Merger:GitCenter"])
++ zeroPage.cmd("wrapperPermissionAdd", ["Merger:NewCenter"])
```
#### Observed Results:
error
```plain
Internal error: Exception('Merger site (NewCenter) does not have permission for merged site:
18r929Hq8hE5Pi9Zf7ovMQVyn3WcGfxMgu (GitCenter)'): Merger site (NewCenter) does not have permission for merged site:
18r929Hq8hE5Pi9Zf7ovMQVyn3WcGfxMgu (GitCenter)
UiWebsocket.py line 80 > 238 > MergerSite/MergerSitePlugin.py line 168 > 136 > 43
```
sites.json
```
permissions: { ..."Gitcenter", "NewCenter"...
}
```
#### Expected Results:
Absention of GitCenter permissions.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with MergerSite/MergerSitePlugin.py around line 168 and the UiWebsocket.py call path around line 80. Reproduce the permission change with wrapperPermissionAdd, then trace how merger permissions are stored and updated. Done means changing the wrapper permission no longer leaves the old merger permission and the reported GitCenter lookup error is absent.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- authorization, backend
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100