是否有一个等效的before_action:authenticate_user!主动管理员?

时间:2019-04-09 15:05:32

标签: ruby-on-rails activeadmin

如果非管理员用户访问某个页面,是否有等效于sum_mod_tloader = utils.DataLoader( RandomModuloDataset(DATASHAPE, sum_mod_label)) fitit(sum_mod_tloader, epochs=50) [1] loss: 1.059 [2] loss: 1.065 [3] loss: 1.079 [4] loss: 1.087 [5] loss: 1.091 [6] loss: 1.092 [7] loss: 1.092 [8] loss: 1.092 [9] loss: 1.092 [10] loss: 1.091 [11] loss: 1.091 [12] loss: 1.091 [13] loss: 1.091 [14] loss: 1.091 [15] loss: 1.090 [16] loss: 1.090 [17] loss: 1.090 [18] loss: 1.090 [19] loss: 1.090 [20] loss: 1.090 [21] loss: 1.090 [22] loss: 1.089 [23] loss: 1.089 [24] loss: 1.089 [25] loss: 1.089 [26] loss: 1.089 [27] loss: 1.089 [28] loss: 1.089 [29] loss: 1.089 [30] loss: 1.089 [31] loss: 1.089 [32] loss: 1.089 [33] loss: 1.089 [34] loss: 1.089 [35] loss: 1.089 [36] loss: 1.089 [37] loss: 1.089 [38] loss: 1.089 [39] loss: 1.089 [40] loss: 1.089 [41] loss: 1.089 [42] loss: 1.089 [43] loss: 1.089 [44] loss: 1.089 [45] loss: 1.089 [46] loss: 1.089 [47] loss: 1.089 [48] loss: 1.089 [49] loss: 1.089 [50] loss: 1.089 的Active Admin重定向到管理员登录页面?

例如,凭着我的意愿

before_action :authenticate_user!

我想对管理员用户进行相同的检查。

有任何线索吗?

1 个答案:

答案 0 :(得分:0)

您可以使用ActiveAdmin授权适配器来设置CanCanAdapter,如果未授权用户,可以为其配置调用方法,请查阅文档here