mirror of https://codeberg.org/gitnex/GitNex.git
Display Admin Menue Only If you are Admin
This commit is contained in:
parent
d7ef368f0b
commit
3fb063b0b1
|
@ -464,6 +464,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||
assert userDetails != null;
|
||||
if(userDetails.getIs_admin() != null) {
|
||||
tinyDb.putBoolean("userIsAdmin", userDetails.getIs_admin());
|
||||
navigationView.getMenu().findItem(R.id.nav_administration).setVisible(userDetails.getIs_admin());
|
||||
}
|
||||
tinyDb.putString("userLogin", userDetails.getLogin());
|
||||
tinyDb.putInt("userId", userDetails.getId());
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
android:title="@string/navProfile" />
|
||||
<item android:id="@+id/nav_administration"
|
||||
android:icon="@drawable/ic_admin"
|
||||
android:title="@string/navAdministration" />
|
||||
android:title="@string/navAdministration"
|
||||
android:visible="false" />
|
||||
</group>
|
||||
|
||||
<group android:checkableBehavior="single"
|
||||
|
|
Loading…
Reference in New Issue